13 #error "AltiVec support not enabled"
19 #define __CR6_EQ_REV 1
21 #define __CR6_LT_REV 3
23 #define __CR6_GT_REV 5
25 #define __CR6_SO_REV 7
28 #define __VEC_CLASS_FP_SUBNORMAL_N (1 << 0)
29 #define __VEC_CLASS_FP_SUBNORMAL_P (1 << 1)
30 #define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | \
31 __VEC_CLASS_FP_SUBNORMAL_N)
32 #define __VEC_CLASS_FP_ZERO_N (1<<2)
33 #define __VEC_CLASS_FP_ZERO_P (1<<3)
34 #define __VEC_CLASS_FP_ZERO (__VEC_CLASS_FP_ZERO_P | \
35 __VEC_CLASS_FP_ZERO_N)
36 #define __VEC_CLASS_FP_INFINITY_N (1<<4)
37 #define __VEC_CLASS_FP_INFINITY_P (1<<5)
38 #define __VEC_CLASS_FP_INFINITY (__VEC_CLASS_FP_INFINITY_P | \
39 __VEC_CLASS_FP_INFINITY_N)
40 #define __VEC_CLASS_FP_NAN (1<<6)
41 #define __VEC_CLASS_FP_NOT_NORMAL (__VEC_CLASS_FP_NAN | \
42 __VEC_CLASS_FP_SUBNORMAL | \
43 __VEC_CLASS_FP_ZERO | \
44 __VEC_CLASS_FP_INFINITY)
46 #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
51 vector
signed char __a, vector
signed char __b, vector
unsigned char __c);
55 vector
unsigned char __c);
61 vector
signed short __b,
62 vector
unsigned char __c);
66 vector
unsigned char __c);
69 vector
bool short __a, vector
bool short __b, vector
unsigned char __c);
73 vector
unsigned char __c);
76 vector
signed int __b,
77 vector
unsigned char __c);
80 vector
unsigned int __a, vector
unsigned int __b, vector
unsigned char __c);
87 vector
unsigned char __c);
92 vector
unsigned char __c);
95 vec_perm(vector
unsigned long long __a, vector
unsigned long long __b,
96 vector
unsigned char __c);
100 vector
unsigned char __c);
104 vector
unsigned char __c);
112 #define __builtin_altivec_abs_v16qi vec_abs
113 #define __builtin_altivec_abs_v8hi vec_abs
114 #define __builtin_altivec_abs_v4si vec_abs
118 return __builtin_altivec_vmaxsb(
__a, -
__a);
123 return __builtin_altivec_vmaxsh(
__a, -
__a);
128 return __builtin_altivec_vmaxsw(
__a, -
__a);
131 #ifdef __POWER8_VECTOR__
134 return __builtin_altivec_vmaxsd(
__a, -
__a);
140 return __builtin_vsx_xvabssp(
__a);
142 vector
unsigned int __res =
143 (vector
unsigned int)
__a & (vector
unsigned int)(0x7FFFFFFF);
144 return (vector
float)__res;
150 return __builtin_vsx_xvabsdp(
__a);
155 #define __builtin_altivec_abss_v16qi vec_abss
156 #define __builtin_altivec_abss_v8hi vec_abss
157 #define __builtin_altivec_abss_v4si vec_abss
161 return __builtin_altivec_vmaxsb(
162 __a, __builtin_altivec_vsubsbs((vector
signed char)(0),
__a));
167 return __builtin_altivec_vmaxsh(
168 __a, __builtin_altivec_vsubshs((vector
signed short)(0),
__a));
173 return __builtin_altivec_vmaxsw(
174 __a, __builtin_altivec_vsubsws((vector
signed int)(0),
__a));
178 #if defined(__POWER9_VECTOR__)
181 vec_absd(vector
unsigned char __a, vector
unsigned char __b) {
182 return __builtin_altivec_vabsdub(
__a,
__b);
186 vec_absd(vector
unsigned short __a, vector
unsigned short __b) {
187 return __builtin_altivec_vabsduh(
__a,
__b);
191 vec_absd(vector
unsigned int __a, vector
unsigned int __b) {
192 return __builtin_altivec_vabsduw(
__a,
__b);
206 return (vector
signed char)
__a +
__b;
211 return __a + (vector
signed char)
__b;
221 return (vector
unsigned char)
__a +
__b;
226 return __a + (vector
unsigned char)
__b;
236 return (vector
short)
__a +
__b;
240 vector
bool short __b) {
241 return __a + (vector short)
__b;
251 return (vector
unsigned short)
__a +
__b;
256 return __a + (vector
unsigned short)
__b;
266 return (vector
int)
__a +
__b;
270 vector
bool int __b) {
281 return (vector
unsigned int)
__a +
__b;
289 #ifdef __POWER8_VECTOR__
291 vec_add(vector
signed long long __a, vector
signed long long __b) {
295 static __inline__ vector
unsigned long long __ATTRS_o_ai
296 vec_add(vector
unsigned long long __a, vector
unsigned long long __b) {
300 #ifdef __SIZEOF_INT128__
302 vec_add(vector
signed __int128
__a, vector
signed __int128
__b) {
307 vec_add(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
312 static __inline__ vector
unsigned char __attribute__((__always_inline__))
313 vec_add_u128(vector
unsigned char __a, vector
unsigned char __b) {
314 return __builtin_altivec_vadduqm(
__a,
__b);
316 #elif defined(__VSX__)
318 vec_add(vector
signed long long __a, vector
signed long long __b) {
319 #ifdef __LITTLE_ENDIAN__
324 vector
unsigned int __res =
325 (vector
unsigned int)
__a + (vector
unsigned int)
__b;
326 vector
unsigned int __carry = __builtin_altivec_vaddcuw(
327 (vector
unsigned int)
__a, (vector
unsigned int)
__b);
328 __carry = __builtin_shufflevector((vector
unsigned char)__carry,
329 (vector
unsigned char)__carry, 0, 0, 0, 7,
330 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0);
331 return (vector
signed long long)(__res + __carry);
335 static __inline__ vector
unsigned long long __ATTRS_o_ai
336 vec_add(vector
unsigned long long __a, vector
unsigned long long __b) {
337 return (vector
unsigned long long)
vec_add((vector
signed long long)
__a,
338 (vector
signed long long)
__b);
340 #endif // __POWER8_VECTOR__
356 #ifdef __POWER8_VECTOR__
357 #ifdef __SIZEOF_INT128__
360 vector
signed __int128
__c) {
361 return __builtin_altivec_vaddeuqm(
__a,
__b,
__c);
365 vec_adde(vector
unsigned __int128
__a, vector
unsigned __int128
__b,
366 vector
unsigned __int128
__c) {
367 return __builtin_altivec_vaddeuqm(
__a,
__b,
__c);
371 static __inline__ vector
unsigned char __attribute__((__always_inline__))
372 vec_adde_u128(vector
unsigned char __a, vector
unsigned char __b,
373 vector
unsigned char __c) {
374 return (vector
unsigned char)__builtin_altivec_vaddeuqm(
__a,
__b,
__c);
380 vector
signed int __c) {
381 vector
signed int __mask = {1, 1, 1, 1};
382 vector
signed int __carry =
__c & __mask;
388 vector
unsigned int __c) {
389 vector
unsigned int __mask = {1, 1, 1, 1};
390 vector
unsigned int __carry =
__c & __mask;
396 #ifdef __POWER8_VECTOR__
397 #ifdef __SIZEOF_INT128__
399 vec_addec(vector
signed __int128
__a, vector
signed __int128
__b,
400 vector
signed __int128
__c) {
401 return __builtin_altivec_vaddecuq(
__a,
__b,
__c);
405 vec_addec(vector
unsigned __int128
__a, vector
unsigned __int128
__b,
406 vector
unsigned __int128
__c) {
407 return __builtin_altivec_vaddecuq(
__a,
__b,
__c);
411 static __inline__ vector
unsigned char __attribute__((__always_inline__))
412 vec_addec_u128(vector
unsigned char __a, vector
unsigned char __b,
413 vector
unsigned char __c) {
414 return (vector
unsigned char)__builtin_altivec_vaddecuq(
__a,
__b,
__c);
419 vec_addec(vector
signed int __a, vector
signed int __b,
420 vector
signed int __c) {
422 signed int __result[4];
423 for (
int i = 0; i < 4; i++) {
424 unsigned int __tempa = (
unsigned int)
__a[i];
425 unsigned int __tempb = (
unsigned int)
__b[i];
426 unsigned int __tempc = (
unsigned int)
__c[i];
427 __tempc = __tempc & 0x00000001;
428 unsigned long long __longa = (
unsigned long long) __tempa;
429 unsigned long long __longb = (
unsigned long long) __tempb;
430 unsigned long long __longc = (
unsigned long long) __tempc;
431 unsigned long long __sum = __longa + __longb + __longc;
432 unsigned long long __res = (__sum >> 32) & 0x01;
433 unsigned long long __tempres = (
unsigned int) __res;
434 __result[i] = (
signed int) __tempres;
437 vector
signed int ret = { __result[0], __result[1], __result[2], __result[3] };
442 vec_addec(vector
unsigned int __a, vector
unsigned int __b,
443 vector
unsigned int __c) {
445 unsigned int __result[4];
446 for (
int i = 0; i < 4; i++) {
447 unsigned int __tempc =
__c[i] & 1;
448 unsigned long long __longa = (
unsigned long long)
__a[i];
449 unsigned long long __longb = (
unsigned long long)
__b[i];
450 unsigned long long __longc = (
unsigned long long) __tempc;
451 unsigned long long __sum = __longa + __longb + __longc;
452 unsigned long long __res = (__sum >> 32) & 0x01;
453 unsigned long long __tempres = (
unsigned int) __res;
454 __result[i] = (
signed int) __tempres;
457 vector
unsigned int ret = { __result[0], __result[1], __result[2], __result[3] };
460 #endif // __powerpc64__
461 #endif // __POWER8_VECTOR__
465 #define __builtin_altivec_vaddubm vec_vaddubm
474 return (vector
signed char)
__a +
__b;
479 return __a + (vector
signed char)
__b;
489 return (vector
unsigned char)
__a +
__b;
494 return __a + (vector
unsigned char)
__b;
499 #define __builtin_altivec_vadduhm vec_vadduhm
508 return (vector
short)
__a +
__b;
512 vector
bool short __b) {
513 return __a + (vector short)
__b;
523 return (vector
unsigned short)
__a +
__b;
528 return __a + (vector
unsigned short)
__b;
533 #define __builtin_altivec_vadduwm vec_vadduwm
542 return (vector
int)
__a +
__b;
546 vector
bool int __b) {
557 return (vector
unsigned int)
__a +
__b;
567 #define __builtin_altivec_vaddfp vec_vaddfp
569 static __inline__ vector
float __attribute__((__always_inline__))
570 vec_vaddfp(vector
float __a, vector
float __b) {
578 return (vector
signed int)__builtin_altivec_vaddcuw((vector
unsigned int)
__a,
579 (vector
unsigned int)
__b);
584 return __builtin_altivec_vaddcuw(
__a,
__b);
587 #ifdef __POWER8_VECTOR__
588 #ifdef __SIZEOF_INT128__
590 vec_addc(vector
signed __int128
__a, vector
signed __int128
__b) {
591 return (vector
signed __int128)__builtin_altivec_vaddcuq(
592 (vector
unsigned __int128)
__a, (vector
unsigned __int128)
__b);
596 vec_addc(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
597 return __builtin_altivec_vaddcuq(
__a,
__b);
601 static __inline__ vector
unsigned char __attribute__((__always_inline__))
602 vec_addc_u128(vector
unsigned char __a, vector
unsigned char __b) {
603 return (vector
unsigned char)__builtin_altivec_vaddcuq(
__a,
__b);
605 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
609 static __inline__ vector
unsigned int __attribute__((__always_inline__))
610 vec_vaddcuw(vector
unsigned int __a, vector
unsigned int __b) {
611 return __builtin_altivec_vaddcuw(
__a,
__b);
618 return __builtin_altivec_vaddsbs(
__a,
__b);
623 return __builtin_altivec_vaddsbs((vector
signed char)
__a,
__b);
628 return __builtin_altivec_vaddsbs(
__a, (vector
signed char)
__b);
633 return __builtin_altivec_vaddubs(
__a,
__b);
638 return __builtin_altivec_vaddubs((vector
unsigned char)
__a,
__b);
643 return __builtin_altivec_vaddubs(
__a, (vector
unsigned char)
__b);
648 return __builtin_altivec_vaddshs(
__a,
__b);
653 return __builtin_altivec_vaddshs((vector
short)
__a,
__b);
657 vector
bool short __b) {
658 return __builtin_altivec_vaddshs(
__a, (vector
short)
__b);
663 return __builtin_altivec_vadduhs(
__a,
__b);
668 return __builtin_altivec_vadduhs((vector
unsigned short)
__a,
__b);
673 return __builtin_altivec_vadduhs(
__a, (vector
unsigned short)
__b);
678 return __builtin_altivec_vaddsws(
__a,
__b);
683 return __builtin_altivec_vaddsws((vector
int)
__a,
__b);
687 vector
bool int __b) {
688 return __builtin_altivec_vaddsws(
__a, (vector
int)
__b);
693 return __builtin_altivec_vadduws(
__a,
__b);
698 return __builtin_altivec_vadduws((vector
unsigned int)
__a,
__b);
703 return __builtin_altivec_vadduws(
__a, (vector
unsigned int)
__b);
710 return __builtin_altivec_vaddsbs(
__a,
__b);
715 return __builtin_altivec_vaddsbs((vector
signed char)
__a,
__b);
720 return __builtin_altivec_vaddsbs(
__a, (vector
signed char)
__b);
727 return __builtin_altivec_vaddubs(
__a,
__b);
732 return __builtin_altivec_vaddubs((vector
unsigned char)
__a,
__b);
737 return __builtin_altivec_vaddubs(
__a, (vector
unsigned char)
__b);
744 return __builtin_altivec_vaddshs(
__a,
__b);
749 return __builtin_altivec_vaddshs((vector
short)
__a,
__b);
753 vector
bool short __b) {
754 return __builtin_altivec_vaddshs(
__a, (vector
short)
__b);
761 return __builtin_altivec_vadduhs(
__a,
__b);
766 return __builtin_altivec_vadduhs((vector
unsigned short)
__a,
__b);
771 return __builtin_altivec_vadduhs(
__a, (vector
unsigned short)
__b);
778 return __builtin_altivec_vaddsws(
__a,
__b);
783 return __builtin_altivec_vaddsws((vector
int)
__a,
__b);
787 vector
bool int __b) {
788 return __builtin_altivec_vaddsws(
__a, (vector
int)
__b);
795 return __builtin_altivec_vadduws(
__a,
__b);
800 return __builtin_altivec_vadduws((vector
unsigned int)
__a,
__b);
805 return __builtin_altivec_vadduws(
__a, (vector
unsigned int)
__b);
808 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
809 defined(__SIZEOF_INT128__)
813 vec_vadduqm(vector
signed __int128
__a, vector
signed __int128
__b) {
818 vec_vadduqm(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
825 vec_vaddeuqm(vector
signed __int128
__a, vector
signed __int128
__b,
826 vector
signed __int128
__c) {
827 return __builtin_altivec_vaddeuqm(
__a,
__b,
__c);
831 vec_vaddeuqm(vector
unsigned __int128
__a, vector
unsigned __int128
__b,
832 vector
unsigned __int128
__c) {
833 return __builtin_altivec_vaddeuqm(
__a,
__b,
__c);
839 vec_vaddcuq(vector
signed __int128
__a, vector
signed __int128
__b) {
840 return __builtin_altivec_vaddcuq(
__a,
__b);
844 vec_vaddcuq(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
845 return __builtin_altivec_vaddcuq(
__a,
__b);
851 vec_vaddecuq(vector
signed __int128
__a, vector
signed __int128
__b,
852 vector
signed __int128
__c) {
853 return __builtin_altivec_vaddecuq(
__a,
__b,
__c);
857 vec_vaddecuq(vector
unsigned __int128
__a, vector
unsigned __int128
__b,
858 vector
unsigned __int128
__c) {
859 return __builtin_altivec_vaddecuq(
__a,
__b,
__c);
861 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
865 #define __builtin_altivec_vand vec_and
874 return (vector
signed char)
__a &
__b;
879 return __a & (vector
signed char)
__b;
889 return (vector
unsigned char)
__a &
__b;
894 return __a & (vector
unsigned char)
__b;
898 vector
bool char __b) {
909 return (vector
short)
__a &
__b;
913 vector
bool short __b) {
914 return __a & (vector short)
__b;
924 return (vector
unsigned short)
__a &
__b;
929 return __a & (vector
unsigned short)
__b;
944 return (vector
int)
__a &
__b;
948 vector
bool int __b) {
959 return (vector
unsigned int)
__a &
__b;
968 vector
bool int __b) {
974 vector
unsigned int __res =
975 (vector
unsigned int)
__a & (vector
unsigned int)
__b;
976 return (vector
float)__res;
981 vector
unsigned int __res =
982 (vector
unsigned int)
__a & (vector
unsigned int)
__b;
983 return (vector
float)__res;
987 vector
bool int __b) {
988 vector
unsigned int __res =
989 (vector
unsigned int)
__a & (vector
unsigned int)
__b;
990 return (vector
float)__res;
996 vector
unsigned long long __res =
997 (vector
unsigned long long)
__a & (vector
unsigned long long)
__b;
998 return (vector
double)__res;
1003 vector
unsigned long long __res =
1004 (vector
unsigned long long)
__a & (vector
unsigned long long)
__b;
1005 return (vector
double)__res;
1009 vector
double __b) {
1010 vector
unsigned long long __res =
1011 (vector
unsigned long long)
__a & (vector
unsigned long long)
__b;
1012 return (vector
double)__res;
1016 vec_and(vector
signed long long __a, vector
signed long long __b) {
1021 vec_and(vector
bool long long __a, vector
signed long long __b) {
1022 return (vector
signed long long)
__a &
__b;
1026 vec_and(vector
signed long long __a, vector
bool long long __b) {
1027 return __a & (vector
signed long long)
__b;
1030 static __inline__ vector
unsigned long long __ATTRS_o_ai
1031 vec_and(vector
unsigned long long __a, vector
unsigned long long __b) {
1035 static __inline__ vector
unsigned long long __ATTRS_o_ai
1036 vec_and(vector
bool long long __a, vector
unsigned long long __b) {
1037 return (vector
unsigned long long)
__a &
__b;
1040 static __inline__ vector
unsigned long long __ATTRS_o_ai
1041 vec_and(vector
unsigned long long __a, vector
bool long long __b) {
1042 return __a & (vector
unsigned long long)
__b;
1046 vec_and(vector
bool long long __a, vector
bool long long __b) {
1060 return (vector
signed char)
__a &
__b;
1065 return __a & (vector
signed char)
__b;
1075 return (vector
unsigned char)
__a &
__b;
1080 return __a & (vector
unsigned char)
__b;
1084 vector
bool char __b) {
1095 return (vector
short)
__a &
__b;
1099 vector
bool short __b) {
1100 return __a & (vector short)
__b;
1110 return (vector
unsigned short)
__a &
__b;
1115 return __a & (vector
unsigned short)
__b;
1130 return (vector
int)
__a &
__b;
1134 vector
bool int __b) {
1145 return (vector
unsigned int)
__a &
__b;
1154 vector
bool int __b) {
1160 vector
unsigned int __res =
1161 (vector
unsigned int)
__a & (vector
unsigned int)
__b;
1162 return (vector
float)__res;
1167 vector
unsigned int __res =
1168 (vector
unsigned int)
__a & (vector
unsigned int)
__b;
1169 return (vector
float)__res;
1173 vector
bool int __b) {
1174 vector
unsigned int __res =
1175 (vector
unsigned int)
__a & (vector
unsigned int)
__b;
1176 return (vector
float)__res;
1181 vec_vand(vector
signed long long __a, vector
signed long long __b) {
1186 vec_vand(vector
bool long long __a, vector
signed long long __b) {
1187 return (vector
signed long long)
__a &
__b;
1191 vec_vand(vector
signed long long __a, vector
bool long long __b) {
1192 return __a & (vector
signed long long)
__b;
1195 static __inline__ vector
unsigned long long __ATTRS_o_ai
1196 vec_vand(vector
unsigned long long __a, vector
unsigned long long __b) {
1200 static __inline__ vector
unsigned long long __ATTRS_o_ai
1201 vec_vand(vector
bool long long __a, vector
unsigned long long __b) {
1202 return (vector
unsigned long long)
__a &
__b;
1205 static __inline__ vector
unsigned long long __ATTRS_o_ai
1206 vec_vand(vector
unsigned long long __a, vector
bool long long __b) {
1207 return __a & (vector
unsigned long long)
__b;
1218 #define __builtin_altivec_vandc vec_andc
1227 return (vector
signed char)
__a & ~
__b;
1232 return __a & ~(vector
signed char)
__b;
1242 return (vector
unsigned char)
__a & ~
__b;
1247 return __a & ~(vector
unsigned char)
__b;
1251 vector
bool char __b) {
1262 return (vector
short)
__a & ~
__b;
1266 vector
bool short __b) {
1267 return __a & ~(vector short)
__b;
1277 return (vector
unsigned short)
__a & ~
__b;
1282 return __a & ~(vector
unsigned short)
__b;
1297 return (vector
int)
__a & ~
__b;
1301 vector
bool int __b) {
1312 return (vector
unsigned int)
__a & ~
__b;
1321 vector
bool int __b) {
1327 vector
unsigned int __res =
1328 (vector
unsigned int)
__a & ~(vector
unsigned int)
__b;
1329 return (vector
float)__res;
1334 vector
unsigned int __res =
1335 (vector
unsigned int)
__a & ~(vector
unsigned int)
__b;
1336 return (vector
float)__res;
1340 vector
bool int __b) {
1341 vector
unsigned int __res =
1342 (vector
unsigned int)
__a & ~(vector
unsigned int)
__b;
1343 return (vector
float)__res;
1348 vector
double __b) {
1349 vector
unsigned long long __res =
1350 (vector
unsigned long long)
__a & ~(vector
unsigned long long)
__b;
1351 return (vector
double)__res;
1356 vector
unsigned long long __res =
1357 (vector
unsigned long long)
__a & ~(vector
unsigned long long)
__b;
1358 return (vector
double)__res;
1362 vector
double __b) {
1363 vector
unsigned long long __res =
1364 (vector
unsigned long long)
__a & ~(vector
unsigned long long)
__b;
1365 return (vector
double)__res;
1369 vec_andc(vector
signed long long __a, vector
signed long long __b) {
1374 vec_andc(vector
bool long long __a, vector
signed long long __b) {
1375 return (vector
signed long long)
__a & ~
__b;
1379 vec_andc(vector
signed long long __a, vector
bool long long __b) {
1380 return __a & ~(vector
signed long long)
__b;
1383 static __inline__ vector
unsigned long long __ATTRS_o_ai
1384 vec_andc(vector
unsigned long long __a, vector
unsigned long long __b) {
1388 static __inline__ vector
unsigned long long __ATTRS_o_ai
1389 vec_andc(vector
bool long long __a, vector
unsigned long long __b) {
1390 return (vector
unsigned long long)
__a & ~
__b;
1393 static __inline__ vector
unsigned long long __ATTRS_o_ai
1394 vec_andc(vector
unsigned long long __a, vector
bool long long __b) {
1395 return __a & ~(vector
unsigned long long)
__b;
1413 return (vector
signed char)
__a & ~
__b;
1418 return __a & ~(vector
signed char)
__b;
1428 return (vector
unsigned char)
__a & ~
__b;
1433 return __a & ~(vector
unsigned char)
__b;
1448 return (vector
short)
__a & ~
__b;
1452 vector
bool short __b) {
1453 return __a & ~(vector short)
__b;
1463 return (vector
unsigned short)
__a & ~
__b;
1468 return __a & ~(vector
unsigned short)
__b;
1483 return (vector
int)
__a & ~
__b;
1487 vector
bool int __b) {
1498 return (vector
unsigned int)
__a & ~
__b;
1507 vector
bool int __b) {
1513 vector
unsigned int __res =
1514 (vector
unsigned int)
__a & ~(vector
unsigned int)
__b;
1515 return (vector
float)__res;
1520 vector
unsigned int __res =
1521 (vector
unsigned int)
__a & ~(vector
unsigned int)
__b;
1522 return (vector
float)__res;
1526 vector
bool int __b) {
1527 vector
unsigned int __res =
1528 (vector
unsigned int)
__a & ~(vector
unsigned int)
__b;
1529 return (vector
float)__res;
1540 return (vector
signed long long)
__a & ~
__b;
1545 return __a & ~(vector
signed long long)
__b;
1548 static __inline__ vector
unsigned long long __ATTRS_o_ai
1549 vec_vandc(vector
unsigned long long __a, vector
unsigned long long __b) {
1553 static __inline__ vector
unsigned long long __ATTRS_o_ai
1555 return (vector
unsigned long long)
__a & ~
__b;
1558 static __inline__ vector
unsigned long long __ATTRS_o_ai
1560 return __a & ~(vector
unsigned long long)
__b;
1573 return __builtin_altivec_vavgsb(
__a,
__b);
1578 return __builtin_altivec_vavgub(
__a,
__b);
1583 return __builtin_altivec_vavgsh(
__a,
__b);
1588 return __builtin_altivec_vavguh(
__a,
__b);
1593 return __builtin_altivec_vavgsw(
__a,
__b);
1598 return __builtin_altivec_vavguw(
__a,
__b);
1603 static __inline__ vector
signed char __attribute__((__always_inline__))
1604 vec_vavgsb(vector
signed char __a, vector
signed char __b) {
1605 return __builtin_altivec_vavgsb(
__a,
__b);
1610 static __inline__ vector
unsigned char __attribute__((__always_inline__))
1611 vec_vavgub(vector
unsigned char __a, vector
unsigned char __b) {
1612 return __builtin_altivec_vavgub(
__a,
__b);
1617 static __inline__ vector
short __attribute__((__always_inline__))
1618 vec_vavgsh(vector
short __a, vector
short __b) {
1619 return __builtin_altivec_vavgsh(
__a,
__b);
1624 static __inline__ vector
unsigned short __attribute__((__always_inline__))
1625 vec_vavguh(vector
unsigned short __a, vector
unsigned short __b) {
1626 return __builtin_altivec_vavguh(
__a,
__b);
1631 static __inline__ vector
int __attribute__((__always_inline__))
1632 vec_vavgsw(vector
int __a, vector
int __b) {
1633 return __builtin_altivec_vavgsw(
__a,
__b);
1638 static __inline__ vector
unsigned int __attribute__((__always_inline__))
1639 vec_vavguw(vector
unsigned int __a, vector
unsigned int __b) {
1640 return __builtin_altivec_vavguw(
__a,
__b);
1647 return __builtin_vsx_xvrspip(
__a);
1649 return __builtin_altivec_vrfip(
__a);
1655 return __builtin_vsx_xvrdpip(
__a);
1673 vec_vrfip(vector
float __a) {
1674 return __builtin_altivec_vrfip(
__a);
1679 static __inline__ vector
int __attribute__((__always_inline__))
1680 vec_cmpb(vector
float __a, vector
float __b) {
1681 return __builtin_altivec_vcmpbfp(
__a,
__b);
1686 static __inline__ vector
int __attribute__((__always_inline__))
1687 vec_vcmpbfp(vector
float __a, vector
float __b) {
1688 return __builtin_altivec_vcmpbfp(
__a,
__b);
1695 return (vector
bool char)__builtin_altivec_vcmpequb((vector
char)
__a,
1701 return (vector
bool char)__builtin_altivec_vcmpequb((vector
char)
__a,
1707 return (vector
bool char)__builtin_altivec_vcmpequb((vector
char)
__a,
1713 return (vector
bool short)__builtin_altivec_vcmpequh(
__a,
__b);
1718 return (vector
bool short)__builtin_altivec_vcmpequh((vector
short)
__a,
1724 return (vector
bool short)__builtin_altivec_vcmpequh((vector
short)
__a,
1730 return (vector
bool int)__builtin_altivec_vcmpequw(
__a,
__b);
1735 return (vector
bool int)__builtin_altivec_vcmpequw((vector
int)
__a,
1740 vector
bool int __b) {
1741 return (vector
bool int)__builtin_altivec_vcmpequw((vector
int)
__a,
1745 #ifdef __POWER8_VECTOR__
1748 return (vector
bool long long)__builtin_altivec_vcmpequd(
__a,
__b);
1752 vec_cmpeq(vector
unsigned long long __a, vector
unsigned long long __b) {
1753 return (vector
bool long long)__builtin_altivec_vcmpequd(
1754 (vector
long long)
__a, (vector
long long)
__b);
1759 return (vector
bool long long)__builtin_altivec_vcmpequd(
1760 (vector
long long)
__a, (vector
long long)
__b);
1762 #elif defined(__VSX__)
1765 vector
bool int __wordcmp =
1767 #ifdef __LITTLE_ENDIAN__
1768 __wordcmp &= __builtin_shufflevector(__wordcmp, __wordcmp, 3, 0, 1, 2);
1769 return (vector
bool long long)__builtin_shufflevector(__wordcmp, __wordcmp, 1,
1772 __wordcmp &= __builtin_shufflevector(__wordcmp, __wordcmp, 1, 2, 3, 0);
1773 return (vector
bool long long)__builtin_shufflevector(__wordcmp, __wordcmp, 0,
1779 vec_cmpeq(vector
unsigned long long __a, vector
unsigned long long __b) {
1780 return vec_cmpeq((vector
signed long long)
__a, (vector
signed long long)
__b);
1785 return vec_cmpeq((vector
signed long long)
__a, (vector
signed long long)
__b);
1792 return (vector
bool int)__builtin_vsx_xvcmpeqsp(
__a,
__b);
1794 return (vector
bool int)__builtin_altivec_vcmpeqfp(
__a,
__b);
1801 return (vector
bool long long)__builtin_vsx_xvcmpeqdp(
__a,
__b);
1805 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1808 return (vector
bool __int128)__builtin_altivec_vcmpequq(
1809 (vector
bool __int128)
__a, (vector
bool __int128)
__b);
1813 vec_cmpeq(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
1814 return (vector
bool __int128)__builtin_altivec_vcmpequq(
1815 (vector
bool __int128)
__a, (vector
bool __int128)
__b);
1820 return (vector
bool __int128)__builtin_altivec_vcmpequq(
__a,
__b);
1824 #ifdef __POWER9_VECTOR__
1829 return (vector
bool char)__builtin_altivec_vcmpneb((vector
char)
__a,
1835 return (vector
bool char)__builtin_altivec_vcmpneb((vector
char)
__a,
1841 return (vector
bool char)__builtin_altivec_vcmpneb((vector
char)
__a,
1847 return (vector
bool short)__builtin_altivec_vcmpneh((vector
short)
__a,
1853 return (vector
bool short)__builtin_altivec_vcmpneh((vector
short)
__a,
1859 return (vector
bool short)__builtin_altivec_vcmpneh((vector
short)
__a,
1865 return (vector
bool int)__builtin_altivec_vcmpnew((vector
int)
__a,
1871 return (vector
bool int)__builtin_altivec_vcmpnew((vector
int)
__a,
1877 return (vector
bool int)__builtin_altivec_vcmpnew((vector
int)
__a,
1883 return (vector
bool int)__builtin_altivec_vcmpnew((vector
int)
__a,
1887 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1889 vec_cmpne(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
1890 return (vector
bool __int128) ~(__builtin_altivec_vcmpequq(
1891 (vector
bool __int128)
__a, (vector
bool __int128)
__b));
1896 return (vector
bool __int128) ~(__builtin_altivec_vcmpequq(
1897 (vector
bool __int128)
__a, (vector
bool __int128)
__b));
1902 return (vector
bool __int128) ~(__builtin_altivec_vcmpequq(
__a,
__b));
1909 vec_cmpnez(vector
signed char __a, vector
signed char __b) {
1910 return (vector
bool char)__builtin_altivec_vcmpnezb((vector
char)
__a,
1915 vec_cmpnez(vector
unsigned char __a, vector
unsigned char __b) {
1916 return (vector
bool char)__builtin_altivec_vcmpnezb((vector
char)
__a,
1921 vec_cmpnez(vector
signed short __a, vector
signed short __b) {
1922 return (vector
bool short)__builtin_altivec_vcmpnezh((vector
short)
__a,
1927 vec_cmpnez(vector
unsigned short __a, vector
unsigned short __b) {
1928 return (vector
bool short)__builtin_altivec_vcmpnezh((vector
short)
__a,
1933 vec_cmpnez(vector
signed int __a, vector
signed int __b) {
1934 return (vector
bool int)__builtin_altivec_vcmpnezw((vector
int)
__a,
1939 vec_cmpnez(vector
unsigned int __a, vector
unsigned int __b) {
1940 return (vector
bool int)__builtin_altivec_vcmpnezw((vector
int)
__a,
1945 vec_cntlz_lsbb(vector
signed char __a) {
1946 #ifdef __LITTLE_ENDIAN__
1947 return __builtin_altivec_vctzlsbb(
__a);
1949 return __builtin_altivec_vclzlsbb(
__a);
1954 vec_cntlz_lsbb(vector
unsigned char __a) {
1955 #ifdef __LITTLE_ENDIAN__
1956 return __builtin_altivec_vctzlsbb(
__a);
1958 return __builtin_altivec_vclzlsbb(
__a);
1963 vec_cnttz_lsbb(vector
signed char __a) {
1964 #ifdef __LITTLE_ENDIAN__
1965 return __builtin_altivec_vclzlsbb(
__a);
1967 return __builtin_altivec_vctzlsbb(
__a);
1972 vec_cnttz_lsbb(vector
unsigned char __a) {
1973 #ifdef __LITTLE_ENDIAN__
1974 return __builtin_altivec_vclzlsbb(
__a);
1976 return __builtin_altivec_vctzlsbb(
__a);
1981 vec_parity_lsbb(vector
unsigned int __a) {
1982 return __builtin_altivec_vprtybw(
__a);
1986 vec_parity_lsbb(vector
signed int __a) {
1987 return __builtin_altivec_vprtybw(
__a);
1990 #ifdef __SIZEOF_INT128__
1991 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
1992 vec_parity_lsbb(vector
unsigned __int128
__a) {
1993 return __builtin_altivec_vprtybq(
__a);
1996 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
1997 vec_parity_lsbb(vector
signed __int128
__a) {
1998 return __builtin_altivec_vprtybq(
__a);
2002 static __inline__ vector
unsigned long long __ATTRS_o_ai
2003 vec_parity_lsbb(vector
unsigned long long __a) {
2004 return __builtin_altivec_vprtybd(
__a);
2007 static __inline__ vector
unsigned long long __ATTRS_o_ai
2008 vec_parity_lsbb(vector
signed long long __a) {
2009 return __builtin_altivec_vprtybd(
__a);
2066 #ifdef __POWER8_VECTOR__
2069 return (vector
bool long long)
2070 ~(__builtin_altivec_vcmpequd((vector
long long)
__a, (vector
long long)
__b));
2075 return (vector
bool long long)
2076 ~(__builtin_altivec_vcmpequd((vector
long long)
__a, (vector
long long)
__b));
2080 vec_cmpne(vector
unsigned long long __a, vector
unsigned long long __b) {
2081 return (vector
bool long long)
2082 ~(__builtin_altivec_vcmpequd((vector
long long)
__a, (vector
long long)
__b));
2084 #elif defined(__VSX__)
2087 return (vector
bool long long)~(
2088 vec_cmpeq((vector
signed long long)
__a, (vector
signed long long)
__b));
2093 return (vector
bool long long)~(
2094 vec_cmpeq((vector
signed long long)
__a, (vector
signed long long)
__b));
2098 vec_cmpne(vector
unsigned long long __a, vector
unsigned long long __b) {
2099 return (vector
bool long long)~(
2100 vec_cmpeq((vector
signed long long)
__a, (vector
signed long long)
__b));
2107 return (vector
bool long long)
2108 ~(__builtin_altivec_vcmpequd((vector
long long)
__a, (vector
long long)
__b));
2116 return (vector
bool char)__builtin_altivec_vcmpgtsb(
__a,
__b);
2121 return (vector
bool char)__builtin_altivec_vcmpgtub(
__a,
__b);
2126 return (vector
bool short)__builtin_altivec_vcmpgtsh(
__a,
__b);
2131 return (vector
bool short)__builtin_altivec_vcmpgtuh(
__a,
__b);
2136 return (vector
bool int)__builtin_altivec_vcmpgtsw(
__a,
__b);
2141 return (vector
bool int)__builtin_altivec_vcmpgtuw(
__a,
__b);
2144 #ifdef __POWER8_VECTOR__
2147 return (vector
bool long long)__builtin_altivec_vcmpgtsd(
__a,
__b);
2151 vec_cmpgt(vector
unsigned long long __a, vector
unsigned long long __b) {
2152 return (vector
bool long long)__builtin_altivec_vcmpgtud(
__a,
__b);
2154 #elif defined(__VSX__)
2157 vector
signed int __sgtw = (vector
signed int)
vec_cmpgt(
2158 (vector
signed int)
__a, (vector
signed int)
__b);
2159 vector
unsigned int __ugtw = (vector
unsigned int)
vec_cmpgt(
2160 (vector
unsigned int)
__a, (vector
unsigned int)
__b);
2161 vector
unsigned int __eqw = (vector
unsigned int)
vec_cmpeq(
2162 (vector
signed int)
__a, (vector
signed int)
__b);
2163 #ifdef __LITTLE_ENDIAN__
2164 __ugtw = __builtin_shufflevector(__ugtw, __ugtw, 3, 0, 1, 2) & __eqw;
2165 __sgtw |= (vector
signed int)__ugtw;
2166 return (vector
bool long long)__builtin_shufflevector(__sgtw, __sgtw, 1, 1, 3,
2169 __ugtw = __builtin_shufflevector(__ugtw, __ugtw, 1, 2, 3, 0) & __eqw;
2170 __sgtw |= (vector
signed int)__ugtw;
2171 return (vector
bool long long)__builtin_shufflevector(__sgtw, __sgtw, 0, 0, 2,
2177 vec_cmpgt(vector
unsigned long long __a, vector
unsigned long long __b) {
2178 vector
unsigned int __ugtw = (vector
unsigned int)
vec_cmpgt(
2179 (vector
unsigned int)
__a, (vector
unsigned int)
__b);
2180 vector
unsigned int __eqw = (vector
unsigned int)
vec_cmpeq(
2181 (vector
signed int)
__a, (vector
signed int)
__b);
2182 #ifdef __LITTLE_ENDIAN__
2183 __eqw = __builtin_shufflevector(__ugtw, __ugtw, 3, 0, 1, 2) & __eqw;
2185 return (vector
bool long long)__builtin_shufflevector(__ugtw, __ugtw, 1, 1, 3,
2188 __eqw = __builtin_shufflevector(__ugtw, __ugtw, 1, 2, 3, 0) & __eqw;
2190 return (vector
bool long long)__builtin_shufflevector(__ugtw, __ugtw, 0, 0, 2,
2199 return (vector
bool int)__builtin_vsx_xvcmpgtsp(
__a,
__b);
2201 return (vector
bool int)__builtin_altivec_vcmpgtfp(
__a,
__b);
2208 return (vector
bool long long)__builtin_vsx_xvcmpgtdp(
__a,
__b);
2212 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2215 return (vector
bool __int128)__builtin_altivec_vcmpgtsq(
2216 (vector
bool __int128)
__a, (vector
bool __int128)
__b);
2220 vec_cmpgt(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
2221 return (vector
bool __int128)__builtin_altivec_vcmpgtuq(
2222 (vector
bool __int128)
__a, (vector
bool __int128)
__b);
2261 return (vector
bool int)__builtin_vsx_xvcmpgesp(
__a,
__b);
2263 return (vector
bool int)__builtin_altivec_vcmpgefp(
__a,
__b);
2270 return (vector
bool long long)__builtin_vsx_xvcmpgedp(
__a,
__b);
2279 vec_cmpge(vector
unsigned long long __a, vector
unsigned long long __b) {
2284 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2291 vec_cmpge(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
2298 static __inline__ vector
bool int __attribute__((__always_inline__))
2299 vec_vcmpgefp(vector
float __a, vector
float __b) {
2300 return (vector
bool int)__builtin_altivec_vcmpgefp(
__a,
__b);
2305 static __inline__ vector
bool char __attribute__((__always_inline__))
2306 vec_vcmpgtsb(vector
signed char __a, vector
signed char __b) {
2307 return (vector
bool char)__builtin_altivec_vcmpgtsb(
__a,
__b);
2312 static __inline__ vector
bool char __attribute__((__always_inline__))
2313 vec_vcmpgtub(vector
unsigned char __a, vector
unsigned char __b) {
2314 return (vector
bool char)__builtin_altivec_vcmpgtub(
__a,
__b);
2319 static __inline__ vector
bool short __attribute__((__always_inline__))
2320 vec_vcmpgtsh(vector
short __a, vector
short __b) {
2321 return (vector
bool short)__builtin_altivec_vcmpgtsh(
__a,
__b);
2326 static __inline__ vector
bool short __attribute__((__always_inline__))
2327 vec_vcmpgtuh(vector
unsigned short __a, vector
unsigned short __b) {
2328 return (vector
bool short)__builtin_altivec_vcmpgtuh(
__a,
__b);
2333 static __inline__ vector
bool int __attribute__((__always_inline__))
2334 vec_vcmpgtsw(vector
int __a, vector
int __b) {
2335 return (vector
bool int)__builtin_altivec_vcmpgtsw(
__a,
__b);
2340 static __inline__ vector
bool int __attribute__((__always_inline__))
2341 vec_vcmpgtuw(vector
unsigned int __a, vector
unsigned int __b) {
2342 return (vector
bool int)__builtin_altivec_vcmpgtuw(
__a,
__b);
2347 static __inline__ vector
bool int __attribute__((__always_inline__))
2348 vec_vcmpgtfp(vector
float __a, vector
float __b) {
2349 return (vector
bool int)__builtin_altivec_vcmpgtfp(
__a,
__b);
2401 vec_cmple(vector
unsigned long long __a, vector
unsigned long long __b) {
2406 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2413 vec_cmple(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
2462 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2469 vec_cmplt(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
2481 vec_cmplt(vector
unsigned long long __a, vector
unsigned long long __b) {
2486 #ifdef __POWER8_VECTOR__
2490 vec_popcnt(vector
signed char __a) {
2491 return __builtin_altivec_vpopcntb(
__a);
2494 vec_popcnt(vector
unsigned char __a) {
2495 return __builtin_altivec_vpopcntb(
__a);
2498 vec_popcnt(vector
signed short __a) {
2499 return __builtin_altivec_vpopcnth(
__a);
2502 vec_popcnt(vector
unsigned short __a) {
2503 return __builtin_altivec_vpopcnth(
__a);
2506 vec_popcnt(vector
signed int __a) {
2507 return __builtin_altivec_vpopcntw(
__a);
2510 vec_popcnt(vector
unsigned int __a) {
2511 return __builtin_altivec_vpopcntw(
__a);
2513 static __inline__ vector
unsigned long long __ATTRS_o_ai
2514 vec_popcnt(vector
signed long long __a) {
2515 return __builtin_altivec_vpopcntd(
__a);
2517 static __inline__ vector
unsigned long long __ATTRS_o_ai
2518 vec_popcnt(vector
unsigned long long __a) {
2519 return __builtin_altivec_vpopcntd(
__a);
2522 #define vec_vclz vec_cntlz
2526 vec_cntlz(vector
signed char __a) {
2527 return __builtin_altivec_vclzb(
__a);
2530 vec_cntlz(vector
unsigned char __a) {
2531 return __builtin_altivec_vclzb(
__a);
2534 vec_cntlz(vector
signed short __a) {
2535 return __builtin_altivec_vclzh(
__a);
2538 vec_cntlz(vector
unsigned short __a) {
2539 return __builtin_altivec_vclzh(
__a);
2542 vec_cntlz(vector
signed int __a) {
2543 return __builtin_altivec_vclzw(
__a);
2546 vec_cntlz(vector
unsigned int __a) {
2547 return __builtin_altivec_vclzw(
__a);
2550 vec_cntlz(vector
signed long long __a) {
2551 return __builtin_altivec_vclzd(
__a);
2553 static __inline__ vector
unsigned long long __ATTRS_o_ai
2554 vec_cntlz(vector
unsigned long long __a) {
2555 return __builtin_altivec_vclzd(
__a);
2559 #ifdef __POWER9_VECTOR__
2564 vec_cnttz(vector
signed char __a) {
2565 return __builtin_altivec_vctzb(
__a);
2568 vec_cnttz(vector
unsigned char __a) {
2569 return __builtin_altivec_vctzb(
__a);
2572 vec_cnttz(vector
signed short __a) {
2573 return __builtin_altivec_vctzh(
__a);
2576 vec_cnttz(vector
unsigned short __a) {
2577 return __builtin_altivec_vctzh(
__a);
2580 vec_cnttz(vector
signed int __a) {
2581 return __builtin_altivec_vctzw(
__a);
2584 vec_cnttz(vector
unsigned int __a) {
2585 return __builtin_altivec_vctzw(
__a);
2588 vec_cnttz(vector
signed long long __a) {
2589 return __builtin_altivec_vctzd(
__a);
2591 static __inline__ vector
unsigned long long __ATTRS_o_ai
2592 vec_cnttz(vector
unsigned long long __a) {
2593 return __builtin_altivec_vctzd(
__a);
2599 vec_first_match_index(vector
signed char __a, vector
signed char __b) {
2600 vector
unsigned long long __res =
2601 #ifdef __LITTLE_ENDIAN__
2606 if (__res[0] == 64) {
2607 return (__res[1] + 64) >> 3;
2609 return __res[0] >> 3;
2613 vec_first_match_index(vector
unsigned char __a, vector
unsigned char __b) {
2614 vector
unsigned long long __res =
2615 #ifdef __LITTLE_ENDIAN__
2620 if (__res[0] == 64) {
2621 return (__res[1] + 64) >> 3;
2623 return __res[0] >> 3;
2627 vec_first_match_index(vector
signed short __a, vector
signed short __b) {
2628 vector
unsigned long long __res =
2629 #ifdef __LITTLE_ENDIAN__
2634 if (__res[0] == 64) {
2635 return (__res[1] + 64) >> 4;
2637 return __res[0] >> 4;
2641 vec_first_match_index(vector
unsigned short __a, vector
unsigned short __b) {
2642 vector
unsigned long long __res =
2643 #ifdef __LITTLE_ENDIAN__
2648 if (__res[0] == 64) {
2649 return (__res[1] + 64) >> 4;
2651 return __res[0] >> 4;
2655 vec_first_match_index(vector
signed int __a, vector
signed int __b) {
2656 vector
unsigned long long __res =
2657 #ifdef __LITTLE_ENDIAN__
2662 if (__res[0] == 64) {
2663 return (__res[1] + 64) >> 5;
2665 return __res[0] >> 5;
2669 vec_first_match_index(vector
unsigned int __a, vector
unsigned int __b) {
2670 vector
unsigned long long __res =
2671 #ifdef __LITTLE_ENDIAN__
2676 if (__res[0] == 64) {
2677 return (__res[1] + 64) >> 5;
2679 return __res[0] >> 5;
2685 vec_first_match_or_eos_index(vector
signed char __a, vector
signed char __b) {
2691 vector
bool char __tmp2 = __tmp1 |
2695 vector
unsigned long long __res =
2696 #ifdef __LITTLE_ENDIAN__
2697 vec_cnttz((vector
unsigned long long)__tmp2);
2699 vec_cntlz((vector
unsigned long long)__tmp2);
2701 if (__res[0] == 64) {
2702 return (__res[1] + 64) >> 3;
2704 return __res[0] >> 3;
2708 vec_first_match_or_eos_index(vector
unsigned char __a,
2709 vector
unsigned char __b) {
2711 vector
bool char __tmp2 = __tmp1 |
2715 vector
unsigned long long __res =
2716 #ifdef __LITTLE_ENDIAN__
2717 vec_cnttz((vector
unsigned long long)__tmp2);
2719 vec_cntlz((vector
unsigned long long)__tmp2);
2721 if (__res[0] == 64) {
2722 return (__res[1] + 64) >> 3;
2724 return __res[0] >> 3;
2728 vec_first_match_or_eos_index(vector
signed short __a, vector
signed short __b) {
2730 vector
bool short __tmp2 = __tmp1 |
2734 vector
unsigned long long __res =
2735 #ifdef __LITTLE_ENDIAN__
2736 vec_cnttz((vector
unsigned long long)__tmp2);
2738 vec_cntlz((vector
unsigned long long)__tmp2);
2740 if (__res[0] == 64) {
2741 return (__res[1] + 64) >> 4;
2743 return __res[0] >> 4;
2747 vec_first_match_or_eos_index(vector
unsigned short __a,
2748 vector
unsigned short __b) {
2750 vector
bool short __tmp2 = __tmp1 |
2754 vector
unsigned long long __res =
2755 #ifdef __LITTLE_ENDIAN__
2756 vec_cnttz((vector
unsigned long long)__tmp2);
2758 vec_cntlz((vector
unsigned long long)__tmp2);
2760 if (__res[0] == 64) {
2761 return (__res[1] + 64) >> 4;
2763 return __res[0] >> 4;
2767 vec_first_match_or_eos_index(vector
signed int __a, vector
signed int __b) {
2769 vector
bool int __tmp2 = __tmp1 |
vec_cmpeq((vector
signed int)__tmp1,
__a) |
2772 vector
unsigned long long __res =
2773 #ifdef __LITTLE_ENDIAN__
2774 vec_cnttz((vector
unsigned long long)__tmp2);
2776 vec_cntlz((vector
unsigned long long)__tmp2);
2778 if (__res[0] == 64) {
2779 return (__res[1] + 64) >> 5;
2781 return __res[0] >> 5;
2785 vec_first_match_or_eos_index(vector
unsigned int __a, vector
unsigned int __b) {
2787 vector
bool int __tmp2 = __tmp1 |
2791 vector
unsigned long long __res =
2792 #ifdef __LITTLE_ENDIAN__
2793 vec_cnttz((vector
unsigned long long)__tmp2);
2795 vec_cntlz((vector
unsigned long long)__tmp2);
2797 if (__res[0] == 64) {
2798 return (__res[1] + 64) >> 5;
2800 return __res[0] >> 5;
2806 vec_first_mismatch_index(vector
signed char __a, vector
signed char __b) {
2807 vector
unsigned long long __res =
2808 #ifdef __LITTLE_ENDIAN__
2813 if (__res[0] == 64) {
2814 return (__res[1] + 64) >> 3;
2816 return __res[0] >> 3;
2820 vec_first_mismatch_index(vector
unsigned char __a, vector
unsigned char __b) {
2821 vector
unsigned long long __res =
2822 #ifdef __LITTLE_ENDIAN__
2827 if (__res[0] == 64) {
2828 return (__res[1] + 64) >> 3;
2830 return __res[0] >> 3;
2834 vec_first_mismatch_index(vector
signed short __a, vector
signed short __b) {
2835 vector
unsigned long long __res =
2836 #ifdef __LITTLE_ENDIAN__
2841 if (__res[0] == 64) {
2842 return (__res[1] + 64) >> 4;
2844 return __res[0] >> 4;
2848 vec_first_mismatch_index(vector
unsigned short __a, vector
unsigned short __b) {
2849 vector
unsigned long long __res =
2850 #ifdef __LITTLE_ENDIAN__
2855 if (__res[0] == 64) {
2856 return (__res[1] + 64) >> 4;
2858 return __res[0] >> 4;
2862 vec_first_mismatch_index(vector
signed int __a, vector
signed int __b) {
2863 vector
unsigned long long __res =
2864 #ifdef __LITTLE_ENDIAN__
2869 if (__res[0] == 64) {
2870 return (__res[1] + 64) >> 5;
2872 return __res[0] >> 5;
2876 vec_first_mismatch_index(vector
unsigned int __a, vector
unsigned int __b) {
2877 vector
unsigned long long __res =
2878 #ifdef __LITTLE_ENDIAN__
2883 if (__res[0] == 64) {
2884 return (__res[1] + 64) >> 5;
2886 return __res[0] >> 5;
2892 vec_first_mismatch_or_eos_index(vector
signed char __a,
2893 vector
signed char __b) {
2894 vector
unsigned long long __res =
2895 #ifdef __LITTLE_ENDIAN__
2896 vec_cnttz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2898 vec_cntlz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2900 if (__res[0] == 64) {
2901 return (__res[1] + 64) >> 3;
2903 return __res[0] >> 3;
2907 vec_first_mismatch_or_eos_index(vector
unsigned char __a,
2908 vector
unsigned char __b) {
2909 vector
unsigned long long __res =
2910 #ifdef __LITTLE_ENDIAN__
2911 vec_cnttz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2913 vec_cntlz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2915 if (__res[0] == 64) {
2916 return (__res[1] + 64) >> 3;
2918 return __res[0] >> 3;
2922 vec_first_mismatch_or_eos_index(vector
signed short __a,
2923 vector
signed short __b) {
2924 vector
unsigned long long __res =
2925 #ifdef __LITTLE_ENDIAN__
2926 vec_cnttz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2928 vec_cntlz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2930 if (__res[0] == 64) {
2931 return (__res[1] + 64) >> 4;
2933 return __res[0] >> 4;
2937 vec_first_mismatch_or_eos_index(vector
unsigned short __a,
2938 vector
unsigned short __b) {
2939 vector
unsigned long long __res =
2940 #ifdef __LITTLE_ENDIAN__
2941 vec_cnttz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2943 vec_cntlz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2945 if (__res[0] == 64) {
2946 return (__res[1] + 64) >> 4;
2948 return __res[0] >> 4;
2952 vec_first_mismatch_or_eos_index(vector
signed int __a, vector
signed int __b) {
2953 vector
unsigned long long __res =
2954 #ifdef __LITTLE_ENDIAN__
2955 vec_cnttz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2957 vec_cntlz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2959 if (__res[0] == 64) {
2960 return (__res[1] + 64) >> 5;
2962 return __res[0] >> 5;
2966 vec_first_mismatch_or_eos_index(vector
unsigned int __a,
2967 vector
unsigned int __b) {
2968 vector
unsigned long long __res =
2969 #ifdef __LITTLE_ENDIAN__
2970 vec_cnttz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2972 vec_cntlz((vector
unsigned long long)vec_cmpnez(
__a,
__b));
2974 if (__res[0] == 64) {
2975 return (__res[1] + 64) >> 5;
2977 return __res[0] >> 5;
2981 vec_insert_exp(vector
double __a, vector
unsigned long long __b) {
2982 return __builtin_vsx_xviexpdp((vector
unsigned long long)
__a,
__b);
2986 vec_insert_exp(vector
unsigned long long __a, vector
unsigned long long __b) {
2987 return __builtin_vsx_xviexpdp(
__a,
__b);
2991 vec_insert_exp(vector
float __a, vector
unsigned int __b) {
2992 return __builtin_vsx_xviexpsp((vector
unsigned int)
__a,
__b);
2996 vec_insert_exp(vector
unsigned int __a, vector
unsigned int __b) {
2997 return __builtin_vsx_xviexpsp(
__a,
__b);
3000 #if defined(__powerpc64__)
3001 static __inline__ vector
signed char __ATTRS_o_ai vec_xl_len(
const signed char *
__a,
3003 return (vector
signed char)__builtin_vsx_lxvl(
__a, (
__b << 56));
3007 vec_xl_len(
const unsigned char *
__a,
size_t __b) {
3008 return (vector
unsigned char)__builtin_vsx_lxvl(
__a, (
__b << 56));
3011 static __inline__ vector
signed short __ATTRS_o_ai vec_xl_len(
const signed short *
__a,
3013 return (vector
signed short)__builtin_vsx_lxvl(
__a, (
__b << 56));
3017 vec_xl_len(
const unsigned short *
__a,
size_t __b) {
3018 return (vector
unsigned short)__builtin_vsx_lxvl(
__a, (
__b << 56));
3021 static __inline__ vector
signed int __ATTRS_o_ai vec_xl_len(
const signed int *
__a,
3023 return (vector
signed int)__builtin_vsx_lxvl(
__a, (
__b << 56));
3026 static __inline__ vector
unsigned int __ATTRS_o_ai vec_xl_len(
const unsigned int *
__a,
3028 return (vector
unsigned int)__builtin_vsx_lxvl(
__a, (
__b << 56));
3031 static __inline__ vector
float __ATTRS_o_ai vec_xl_len(
const float *
__a,
size_t __b) {
3032 return (vector
float)__builtin_vsx_lxvl(
__a, (
__b << 56));
3035 #ifdef __SIZEOF_INT128__
3037 vec_xl_len(
const signed __int128 *
__a,
size_t __b) {
3038 return (vector
signed __int128)__builtin_vsx_lxvl(
__a, (
__b << 56));
3041 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
3042 vec_xl_len(
const unsigned __int128 *
__a,
size_t __b) {
3043 return (vector
unsigned __int128)__builtin_vsx_lxvl(
__a, (
__b << 56));
3048 vec_xl_len(
const signed long long *
__a,
size_t __b) {
3049 return (vector
signed long long)__builtin_vsx_lxvl(
__a, (
__b << 56));
3052 static __inline__ vector
unsigned long long __ATTRS_o_ai
3053 vec_xl_len(
const unsigned long long *
__a,
size_t __b) {
3054 return (vector
unsigned long long)__builtin_vsx_lxvl(
__a, (
__b << 56));
3057 static __inline__ vector
double __ATTRS_o_ai vec_xl_len(
const double *
__a,
3059 return (vector
double)__builtin_vsx_lxvl(
__a, (
__b << 56));
3063 vec_xl_len_r(
const unsigned char *
__a,
size_t __b) {
3064 vector
unsigned char __res =
3065 (vector
unsigned char)__builtin_vsx_lxvll(
__a, (
__b << 56));
3066 vector
unsigned char __mask =
3067 (vector
unsigned char)__builtin_altivec_lvsr(16 -
__b, (
int *)
NULL);
3068 return (vector
unsigned char)__builtin_altivec_vperm_4si(
3069 (vector
int)__res, (vector
int)__res, __mask);
3073 static __inline__
void __ATTRS_o_ai vec_xst_len(vector
unsigned char __a,
3076 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3079 static __inline__
void __ATTRS_o_ai vec_xst_len(vector
signed char __a,
3080 signed char *
__b,
size_t __c) {
3081 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3084 static __inline__
void __ATTRS_o_ai vec_xst_len(vector
signed short __a,
3085 signed short *
__b,
size_t __c) {
3086 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3089 static __inline__
void __ATTRS_o_ai vec_xst_len(vector
unsigned short __a,
3090 unsigned short *
__b,
3092 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3095 static __inline__
void __ATTRS_o_ai vec_xst_len(vector
signed int __a,
3096 signed int *
__b,
size_t __c) {
3097 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3100 static __inline__
void __ATTRS_o_ai vec_xst_len(vector
unsigned int __a,
3101 unsigned int *
__b,
size_t __c) {
3102 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3107 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3110 #ifdef __SIZEOF_INT128__
3111 static __inline__
void __ATTRS_o_ai vec_xst_len(vector
signed __int128
__a,
3112 signed __int128 *
__b,
3114 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3117 static __inline__
void __ATTRS_o_ai vec_xst_len(vector
unsigned __int128
__a,
3118 unsigned __int128 *
__b,
3120 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3124 static __inline__
void __ATTRS_o_ai vec_xst_len(vector
signed long long __a,
3125 signed long long *
__b,
3127 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3130 static __inline__
void __ATTRS_o_ai vec_xst_len(vector
unsigned long long __a,
3131 unsigned long long *
__b,
3133 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3138 return __builtin_vsx_stxvl((vector
int)
__a,
__b, (
__c << 56));
3141 static __inline__
void __ATTRS_o_ai vec_xst_len_r(vector
unsigned char __a,
3144 vector
unsigned char __mask =
3145 (vector
unsigned char)__builtin_altivec_lvsl(16 -
__c, (
int *)
NULL);
3146 vector
unsigned char __res =
3147 __builtin_altivec_vperm_4si((vector
int)
__a, (vector
int)
__a, __mask);
3148 return __builtin_vsx_stxvll((vector
int)__res,
__b, (
__c << 56));
3153 #if defined(__POWER9_VECTOR__) && defined(__powerpc64__)
3154 #define __vec_ldrmb(PTR, CNT) vec_xl_len_r((const unsigned char *)(PTR), (CNT))
3155 #define __vec_strmb(PTR, CNT, VAL) \
3156 vec_xst_len_r((VAL), (unsigned char *)(PTR), (CNT))
3158 #define __vec_ldrmb __builtin_vsx_ldrmb
3159 #define __vec_strmb __builtin_vsx_strmb
3165 static __inline__ vector
float __ATTRS_o_ai vec_cpsgn(vector
float __a,
3167 return __builtin_vsx_xvcpsgnsp(
__b,
__a);
3170 static __inline__ vector
double __ATTRS_o_ai vec_cpsgn(vector
double __a,
3171 vector
double __b) {
3172 return __builtin_vsx_xvcpsgndp(
__b,
__a);
3182 #ifdef __XL_COMPAT_ALTIVEC__
3183 #define vec_ctf(__a, __b) \
3184 _Generic((__a), vector int \
3185 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
3186 vector unsigned int \
3187 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
3189 vector unsigned long long \
3190 : (__builtin_vsx_xvcvuxdsp((vector unsigned long long)(__a)) * \
3191 (vector float)(vector unsigned)((0x7f - (__b)) << 23)), \
3192 vector signed long long \
3193 : (__builtin_vsx_xvcvsxdsp((vector signed long long)(__a)) * \
3194 (vector float)(vector unsigned)((0x7f - (__b)) << 23)))
3195 #else // __XL_COMPAT_ALTIVEC__
3196 #define vec_ctf(__a, __b) \
3197 _Generic((__a), vector int \
3198 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
3199 vector unsigned int \
3200 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
3202 vector unsigned long long \
3203 : (__builtin_convertvector((vector unsigned long long)(__a), \
3205 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3207 vector signed long long \
3208 : (__builtin_convertvector((vector signed long long)(__a), \
3210 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3212 #endif // __XL_COMPAT_ALTIVEC__
3214 #define vec_ctf(__a, __b) \
3215 _Generic((__a), vector int \
3216 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
3217 vector unsigned int \
3218 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
3224 #define vec_ctd(__a, __b) \
3225 _Generic((__a), vector signed int \
3226 : (vec_doublee((vector signed int)(__a)) * \
3227 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3229 vector unsigned int \
3230 : (vec_doublee((vector unsigned int)(__a)) * \
3231 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3233 vector unsigned long long \
3234 : (__builtin_convertvector((vector unsigned long long)(__a), \
3236 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3238 vector signed long long \
3239 : (__builtin_convertvector((vector signed long long)(__a), \
3241 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3247 #define vec_vcfux __builtin_altivec_vcfux
3250 #define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
3255 #ifdef __XL_COMPAT_ALTIVEC__
3256 #define vec_cts(__a, __b) \
3257 _Generic((__a), vector float \
3258 : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
3261 vector double __ret = \
3262 (vector double)(__a) * \
3263 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
3265 __builtin_vsx_xvcvdpsxws(__ret); \
3267 #else // __XL_COMPAT_ALTIVEC__
3268 #define vec_cts(__a, __b) \
3269 _Generic((__a), vector float \
3270 : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
3273 vector double __ret = \
3274 (vector double)(__a) * \
3275 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
3277 __builtin_convertvector(__ret, vector signed long long); \
3279 #endif // __XL_COMPAT_ALTIVEC__
3281 #define vec_cts __builtin_altivec_vctsxs
3286 #define vec_vctsxs __builtin_altivec_vctsxs
3291 #ifdef __XL_COMPAT_ALTIVEC__
3292 #define vec_ctu(__a, __b) \
3293 _Generic((__a), vector float \
3294 : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
3297 vector double __ret = \
3298 (vector double)(__a) * \
3299 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3301 __builtin_vsx_xvcvdpuxws(__ret); \
3303 #else // __XL_COMPAT_ALTIVEC__
3304 #define vec_ctu(__a, __b) \
3305 _Generic((__a), vector float \
3306 : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
3309 vector double __ret = \
3310 (vector double)(__a) * \
3311 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3313 __builtin_convertvector(__ret, vector unsigned long long); \
3315 #endif // __XL_COMPAT_ALTIVEC__
3317 #define vec_ctu __builtin_altivec_vctuxs
3320 #ifdef __LITTLE_ENDIAN__
3324 #define vec_ctsl(__a, __b) \
3325 _Generic((__a), vector float \
3327 vector float __ret = \
3328 (vector float)(__a) * \
3329 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3330 __builtin_vsx_xvcvspsxds( \
3331 __builtin_vsx_xxsldwi(__ret, __ret, 1)); \
3335 vector double __ret = \
3336 (vector double)(__a) * \
3337 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3339 __builtin_convertvector(__ret, vector signed long long); \
3344 #define vec_ctul(__a, __b) \
3345 _Generic((__a), vector float \
3347 vector float __ret = \
3348 (vector float)(__a) * \
3349 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3350 __builtin_vsx_xvcvspuxds( \
3351 __builtin_vsx_xxsldwi(__ret, __ret, 1)); \
3355 vector double __ret = \
3356 (vector double)(__a) * \
3357 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3359 __builtin_convertvector(__ret, vector unsigned long long); \
3362 #else // __LITTLE_ENDIAN__
3366 #define vec_ctsl(__a, __b) \
3367 _Generic((__a), vector float \
3369 vector float __ret = \
3370 (vector float)(__a) * \
3371 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3372 __builtin_vsx_xvcvspsxds(__ret); \
3376 vector double __ret = \
3377 (vector double)(__a) * \
3378 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3380 __builtin_convertvector(__ret, vector signed long long); \
3385 #define vec_ctul(__a, __b) \
3386 _Generic((__a), vector float \
3388 vector float __ret = \
3389 (vector float)(__a) * \
3390 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3391 __builtin_vsx_xvcvspuxds(__ret); \
3395 vector double __ret = \
3396 (vector double)(__a) * \
3397 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3399 __builtin_convertvector(__ret, vector unsigned long long); \
3402 #endif // __LITTLE_ENDIAN__
3406 #define vec_vctuxs __builtin_altivec_vctuxs
3410 #ifdef __POWER9_VECTOR__
3412 vec_signexti(vector
signed char __a) {
3413 return __builtin_altivec_vextsb2w(
__a);
3417 vec_signexti(vector
signed short __a) {
3418 return __builtin_altivec_vextsh2w(
__a);
3422 vec_signextll(vector
signed char __a) {
3423 return __builtin_altivec_vextsb2d(
__a);
3427 vec_signextll(vector
signed short __a) {
3428 return __builtin_altivec_vextsh2d(
__a);
3432 vec_signextll(vector
signed int __a) {
3433 return __builtin_altivec_vextsw2d(
__a);
3437 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3439 vec_signextq(vector
signed long long __a) {
3440 return __builtin_altivec_vextsd2q(
__a);
3447 vec_sld(vector
signed int, vector
signed int,
unsigned const int __c);
3451 return __builtin_convertvector(
__a, vector
signed int);
3457 return __builtin_convertvector(
__a, vector
signed long long);
3460 static __inline__ vector
signed int __attribute__((__always_inline__))
3461 vec_signed2(vector
double __a, vector
double __b) {
3462 return (vector
signed int) {
__a[0],
__a[1],
__b[0],
__b[1] };
3466 vec_signede(vector
double __a) {
3467 #ifdef __LITTLE_ENDIAN__
3468 vector
signed int __ret = __builtin_vsx_xvcvdpsxws(
__a);
3469 return vec_sld(__ret, __ret, 12);
3471 return __builtin_vsx_xvcvdpsxws(
__a);
3476 vec_signedo(vector
double __a) {
3477 #ifdef __LITTLE_ENDIAN__
3478 return __builtin_vsx_xvcvdpsxws(
__a);
3480 vector
signed int __ret = __builtin_vsx_xvcvdpsxws(
__a);
3481 return vec_sld(__ret, __ret, 12);
3489 vec_sld(vector
unsigned int, vector
unsigned int,
unsigned const int __c);
3493 return __builtin_convertvector(
__a, vector
unsigned int);
3497 static __inline__ vector
unsigned long long __ATTRS_o_ai
3499 return __builtin_convertvector(
__a, vector
unsigned long long);
3502 static __inline__ vector
unsigned int __attribute__((__always_inline__))
3503 vec_unsigned2(vector
double __a, vector
double __b) {
3504 return (vector
unsigned int) {
__a[0],
__a[1],
__b[0],
__b[1] };
3508 vec_unsignede(vector
double __a) {
3509 #ifdef __LITTLE_ENDIAN__
3510 vector
unsigned int __ret = __builtin_vsx_xvcvdpuxws(
__a);
3511 return vec_sld(__ret, __ret, 12);
3513 return __builtin_vsx_xvcvdpuxws(
__a);
3518 vec_unsignedo(vector
double __a) {
3519 #ifdef __LITTLE_ENDIAN__
3520 return __builtin_vsx_xvcvdpuxws(
__a);
3522 vector
unsigned int __ret = __builtin_vsx_xvcvdpuxws(
__a);
3523 return vec_sld(__ret, __ret, 12);
3531 vec_sld(vector
float, vector
float,
unsigned const int __c);
3535 return __builtin_convertvector(
__a, vector
float);
3540 return __builtin_convertvector(
__a, vector
float);
3545 vec_float2(vector
signed long long __a, vector
signed long long __b) {
3546 return (vector
float) {
__a[0],
__a[1],
__b[0],
__b[1] };
3550 vec_float2(vector
unsigned long long __a, vector
unsigned long long __b) {
3551 return (vector
float) {
__a[0],
__a[1],
__b[0],
__b[1] };
3555 vec_float2(vector
double __a, vector
double __b) {
3556 return (vector
float) {
__a[0],
__a[1],
__b[0],
__b[1] };
3560 vec_floate(vector
signed long long __a) {
3561 #ifdef __LITTLE_ENDIAN__
3562 vector
float __ret = __builtin_vsx_xvcvsxdsp(
__a);
3563 return vec_sld(__ret, __ret, 12);
3565 return __builtin_vsx_xvcvsxdsp(
__a);
3570 vec_floate(vector
unsigned long long __a) {
3571 #ifdef __LITTLE_ENDIAN__
3572 vector
float __ret = __builtin_vsx_xvcvuxdsp(
__a);
3573 return vec_sld(__ret, __ret, 12);
3575 return __builtin_vsx_xvcvuxdsp(
__a);
3580 vec_floate(vector
double __a) {
3581 #ifdef __LITTLE_ENDIAN__
3582 vector
float __ret = __builtin_vsx_xvcvdpsp(
__a);
3583 return vec_sld(__ret, __ret, 12);
3585 return __builtin_vsx_xvcvdpsp(
__a);
3590 vec_floato(vector
signed long long __a) {
3591 #ifdef __LITTLE_ENDIAN__
3592 return __builtin_vsx_xvcvsxdsp(
__a);
3594 vector
float __ret = __builtin_vsx_xvcvsxdsp(
__a);
3595 return vec_sld(__ret, __ret, 12);
3600 vec_floato(vector
unsigned long long __a) {
3601 #ifdef __LITTLE_ENDIAN__
3602 return __builtin_vsx_xvcvuxdsp(
__a);
3604 vector
float __ret = __builtin_vsx_xvcvuxdsp(
__a);
3605 return vec_sld(__ret, __ret, 12);
3610 vec_floato(vector
double __a) {
3611 #ifdef __LITTLE_ENDIAN__
3612 return __builtin_vsx_xvcvdpsp(
__a);
3614 vector
float __ret = __builtin_vsx_xvcvdpsp(
__a);
3615 return vec_sld(__ret, __ret, 12);
3624 vec_double(vector
signed long long __a) {
3625 return __builtin_convertvector(
__a, vector
double);
3629 vec_double(vector
unsigned long long __a) {
3630 return __builtin_convertvector(
__a, vector
double);
3634 vec_doublee(vector
signed int __a) {
3635 #ifdef __LITTLE_ENDIAN__
3638 return __builtin_vsx_xvcvsxwdp(
__a);
3643 vec_doublee(vector
unsigned int __a) {
3644 #ifdef __LITTLE_ENDIAN__
3647 return __builtin_vsx_xvcvuxwdp(
__a);
3652 vec_doublee(vector
float __a) {
3653 #ifdef __LITTLE_ENDIAN__
3656 return __builtin_vsx_xvcvspdp(
__a);
3661 vec_doubleh(vector
signed int __a) {
3662 vector
double __ret = {
__a[0],
__a[1]};
3667 vec_doubleh(vector
unsigned int __a) {
3668 vector
double __ret = {
__a[0],
__a[1]};
3673 vec_doubleh(vector
float __a) {
3674 vector
double __ret = {
__a[0],
__a[1]};
3679 vec_doublel(vector
signed int __a) {
3680 vector
double __ret = {
__a[2],
__a[3]};
3685 vec_doublel(vector
unsigned int __a) {
3686 vector
double __ret = {
__a[2],
__a[3]};
3691 vec_doublel(vector
float __a) {
3692 vector
double __ret = {
__a[2],
__a[3]};
3697 vec_doubleo(vector
signed int __a) {
3698 #ifdef __LITTLE_ENDIAN__
3699 return __builtin_vsx_xvcvsxwdp(
__a);
3706 vec_doubleo(vector
unsigned int __a) {
3707 #ifdef __LITTLE_ENDIAN__
3708 return __builtin_vsx_xvcvuxwdp(
__a);
3715 vec_doubleo(vector
float __a) {
3716 #ifdef __LITTLE_ENDIAN__
3717 return __builtin_vsx_xvcvspdp(
__a);
3724 static __inline__ vector
double __ATTRS_o_ai vec_cvf(vector
float __a) {
3725 return vec_doublee(
__a);
3728 static __inline__ vector
float __ATTRS_o_ai vec_cvf(vector
double __a) {
3729 return vec_floate(
__a);
3770 vec_div(vector
signed long long __a, vector
signed long long __b) {
3774 static __inline__ vector
unsigned long long __ATTRS_o_ai
3775 vec_div(vector
unsigned long long __a, vector
unsigned long long __b) {
3785 vector
double __b) {
3792 #ifdef __POWER10_VECTOR__
3794 vec_dive(vector
signed int __a, vector
signed int __b) {
3795 return __builtin_altivec_vdivesw(
__a,
__b);
3799 vec_dive(vector
unsigned int __a, vector
unsigned int __b) {
3800 return __builtin_altivec_vdiveuw(
__a,
__b);
3804 vec_dive(vector
signed long long __a, vector
signed long long __b) {
3805 return __builtin_altivec_vdivesd(
__a,
__b);
3808 static __inline__ vector
unsigned long long __ATTRS_o_ai
3809 vec_dive(vector
unsigned long long __a, vector
unsigned long long __b) {
3810 return __builtin_altivec_vdiveud(
__a,
__b);
3813 #ifdef __SIZEOF_INT128__
3814 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
3815 vec_dive(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
3816 return __builtin_altivec_vdiveuq(
__a,
__b);
3820 vec_dive(vector
signed __int128
__a, vector
signed __int128
__b) {
3821 return __builtin_altivec_vdivesq(
__a,
__b);
3826 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3827 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
3828 vec_div(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
3833 vec_div(vector
signed __int128
__a, vector
signed __int128
__b) {
3842 vector
double __b) {
3843 return __builtin_vsx_xvtdivdp(
__a,
__b);
3848 return __builtin_vsx_xvtdivsp(
__a,
__b);
3854 #define vec_dss __builtin_altivec_dss
3858 static __inline__
void __attribute__((__always_inline__)) vec_dssall(
void) {
3859 __builtin_altivec_dssall();
3863 #define vec_dst(__PTR, __CW, __STR) \
3864 __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR))
3867 #define vec_dstst(__PTR, __CW, __STR) \
3868 __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR))
3871 #define vec_dststt(__PTR, __CW, __STR) \
3872 __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR))
3875 #define vec_dstt(__PTR, __CW, __STR) \
3876 __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR))
3880 #ifdef __POWER8_VECTOR__
3882 vec_eqv(vector
signed char __a, vector
signed char __b) {
3883 return (vector
signed char)__builtin_vsx_xxleqv((vector
unsigned int)
__a,
3884 (vector
unsigned int)
__b);
3888 vec_eqv(vector
unsigned char __a, vector
unsigned char __b) {
3889 return (vector
unsigned char)__builtin_vsx_xxleqv((vector
unsigned int)
__a,
3890 (vector
unsigned int)
__b);
3893 static __inline__ vector
bool char __ATTRS_o_ai vec_eqv(vector
bool char __a,
3894 vector
bool char __b) {
3895 return (vector
bool char)__builtin_vsx_xxleqv((vector
unsigned int)
__a,
3896 (vector
unsigned int)
__b);
3900 vec_eqv(vector
signed short __a, vector
signed short __b) {
3901 return (vector
signed short)__builtin_vsx_xxleqv((vector
unsigned int)
__a,
3902 (vector
unsigned int)
__b);
3906 vec_eqv(vector
unsigned short __a, vector
unsigned short __b) {
3907 return (vector
unsigned short)__builtin_vsx_xxleqv((vector
unsigned int)
__a,
3908 (vector
unsigned int)
__b);
3912 vec_eqv(vector
bool short __a, vector
bool short __b) {
3913 return (vector
bool short)__builtin_vsx_xxleqv((vector
unsigned int)
__a,
3914 (vector
unsigned int)
__b);
3918 vec_eqv(vector
signed int __a, vector
signed int __b) {
3919 return (vector
signed int)__builtin_vsx_xxleqv((vector
unsigned int)
__a,
3920 (vector
unsigned int)
__b);
3924 vec_eqv(vector
unsigned int __a, vector
unsigned int __b) {
3925 return __builtin_vsx_xxleqv(
__a,
__b);
3928 static __inline__ vector
bool int __ATTRS_o_ai vec_eqv(vector
bool int __a,
3929 vector
bool int __b) {
3930 return (vector
bool int)__builtin_vsx_xxleqv((vector
unsigned int)
__a,
3931 (vector
unsigned int)
__b);
3935 vec_eqv(vector
signed long long __a, vector
signed long long __b) {
3936 return (vector
signed long long)__builtin_vsx_xxleqv(
3937 (vector
unsigned int)
__a, (vector
unsigned int)
__b);
3940 static __inline__ vector
unsigned long long __ATTRS_o_ai
3941 vec_eqv(vector
unsigned long long __a, vector
unsigned long long __b) {
3942 return (vector
unsigned long long)__builtin_vsx_xxleqv(
3943 (vector
unsigned int)
__a, (vector
unsigned int)
__b);
3947 vec_eqv(vector
bool long long __a, vector
bool long long __b) {
3948 return (vector
bool long long)__builtin_vsx_xxleqv((vector
unsigned int)
__a,
3949 (vector
unsigned int)
__b);
3954 return (vector
float)__builtin_vsx_xxleqv((vector
unsigned int)
__a,
3955 (vector
unsigned int)
__b);
3958 static __inline__ vector
double __ATTRS_o_ai vec_eqv(vector
double __a,
3959 vector
double __b) {
3960 return (vector
double)__builtin_vsx_xxleqv((vector
unsigned int)
__a,
3961 (vector
unsigned int)
__b);
3967 static __inline__ vector
float __attribute__((__always_inline__))
3968 vec_expte(vector
float __a) {
3969 return __builtin_altivec_vexptefp(
__a);
3974 static __inline__ vector
float __attribute__((__always_inline__))
3975 vec_vexptefp(vector
float __a) {
3976 return __builtin_altivec_vexptefp(
__a);
3983 return __builtin_vsx_xvrspim(
__a);
3985 return __builtin_altivec_vrfim(
__a);
3991 return __builtin_vsx_xvrdpim(
__a);
4008 static __inline__ vector
float __attribute__((__always_inline__))
4009 vec_vrfim(vector
float __a) {
4010 return __builtin_altivec_vrfim(
__a);
4017 return (vector
signed char)__builtin_altivec_lvx(
__a,
__b);
4022 return (vector
signed char)__builtin_altivec_lvx(
__a,
__b);
4027 return (vector
unsigned char)__builtin_altivec_lvx(
__a,
__b);
4032 return (vector
unsigned char)__builtin_altivec_lvx(
__a,
__b);
4037 return (vector
bool char)__builtin_altivec_lvx(
__a,
__b);
4041 const vector
short *
__b) {
4042 return (vector
short)__builtin_altivec_lvx(
__a,
__b);
4046 return (vector
short)__builtin_altivec_lvx(
__a,
__b);
4051 return (vector
unsigned short)__builtin_altivec_lvx(
__a,
__b);
4056 return (vector
unsigned short)__builtin_altivec_lvx(
__a,
__b);
4061 return (vector
bool short)__builtin_altivec_lvx(
__a,
__b);
4065 const vector pixel *
__b) {
4066 return (vector pixel)__builtin_altivec_lvx(
__a,
__b);
4070 const vector
int *
__b) {
4071 return (vector
int)__builtin_altivec_lvx(
__a,
__b);
4075 return (vector
int)__builtin_altivec_lvx(
__a,
__b);
4080 return (vector
unsigned int)__builtin_altivec_lvx(
__a,
__b);
4085 return (vector
unsigned int)__builtin_altivec_lvx(
__a,
__b);
4090 return (vector
bool int)__builtin_altivec_lvx(
__a,
__b);
4094 const vector
float *
__b) {
4095 return (vector
float)__builtin_altivec_lvx(
__a,
__b);
4099 return (vector
float)__builtin_altivec_lvx(
__a,
__b);
4106 return (vector
signed char)__builtin_altivec_lvx(
__a,
__b);
4111 return (vector
signed char)__builtin_altivec_lvx(
__a,
__b);
4116 return (vector
unsigned char)__builtin_altivec_lvx(
__a,
__b);
4121 return (vector
unsigned char)__builtin_altivec_lvx(
__a,
__b);
4126 return (vector
bool char)__builtin_altivec_lvx(
__a,
__b);
4130 const vector
short *
__b) {
4131 return (vector
short)__builtin_altivec_lvx(
__a,
__b);
4135 return (vector
short)__builtin_altivec_lvx(
__a,
__b);
4140 return (vector
unsigned short)__builtin_altivec_lvx(
__a,
__b);
4145 return (vector
unsigned short)__builtin_altivec_lvx(
__a,
__b);
4150 return (vector
bool short)__builtin_altivec_lvx(
__a,
__b);
4154 const vector pixel *
__b) {
4155 return (vector pixel)__builtin_altivec_lvx(
__a,
__b);
4159 const vector
int *
__b) {
4160 return (vector
int)__builtin_altivec_lvx(
__a,
__b);
4164 return (vector
int)__builtin_altivec_lvx(
__a,
__b);
4169 return (vector
unsigned int)__builtin_altivec_lvx(
__a,
__b);
4174 return (vector
unsigned int)__builtin_altivec_lvx(
__a,
__b);
4179 return (vector
bool int)__builtin_altivec_lvx(
__a,
__b);
4183 const vector
float *
__b) {
4184 return (vector
float)__builtin_altivec_lvx(
__a,
__b);
4188 return (vector
float)__builtin_altivec_lvx(
__a,
__b);
4195 return (vector
signed char)__builtin_altivec_lvebx(
__a,
__b);
4200 return (vector
unsigned char)__builtin_altivec_lvebx(
__a,
__b);
4204 return (vector
short)__builtin_altivec_lvehx(
__a,
__b);
4209 return (vector
unsigned short)__builtin_altivec_lvehx(
__a,
__b);
4213 return (vector
int)__builtin_altivec_lvewx(
__a,
__b);
4218 return (vector
unsigned int)__builtin_altivec_lvewx(
__a,
__b);
4222 return (vector
float)__builtin_altivec_lvewx(
__a,
__b);
4229 return (vector
signed char)__builtin_altivec_lvebx(
__a,
__b);
4234 return (vector
unsigned char)__builtin_altivec_lvebx(
__a,
__b);
4241 return (vector
short)__builtin_altivec_lvehx(
__a,
__b);
4246 return (vector
unsigned short)__builtin_altivec_lvehx(
__a,
__b);
4252 return (vector
int)__builtin_altivec_lvewx(
__a,
__b);
4257 return (vector
unsigned int)__builtin_altivec_lvewx(
__a,
__b);
4262 return (vector
float)__builtin_altivec_lvewx(
__a,
__b);
4269 return (vector
signed char)__builtin_altivec_lvxl(
__a,
__b);
4274 return (vector
signed char)__builtin_altivec_lvxl(
__a,
__b);
4279 return (vector
unsigned char)__builtin_altivec_lvxl(
__a,
__b);
4284 return (vector
unsigned char)__builtin_altivec_lvxl(
__a,
__b);
4289 return (vector
bool char)__builtin_altivec_lvxl(
__a,
__b);
4293 const vector
short *
__b) {
4294 return (vector
short)__builtin_altivec_lvxl(
__a,
__b);
4298 return (vector
short)__builtin_altivec_lvxl(
__a,
__b);
4303 return (vector
unsigned short)__builtin_altivec_lvxl(
__a,
__b);
4308 return (vector
unsigned short)__builtin_altivec_lvxl(
__a,
__b);
4313 return (vector
bool short)__builtin_altivec_lvxl(
__a,
__b);
4317 const vector pixel *
__b) {
4318 return (vector pixel
short)__builtin_altivec_lvxl(
__a,
__b);
4322 const vector
int *
__b) {
4323 return (vector
int)__builtin_altivec_lvxl(
__a,
__b);
4327 return (vector
int)__builtin_altivec_lvxl(
__a,
__b);
4332 return (vector
unsigned int)__builtin_altivec_lvxl(
__a,
__b);
4337 return (vector
unsigned int)__builtin_altivec_lvxl(
__a,
__b);
4342 return (vector
bool int)__builtin_altivec_lvxl(
__a,
__b);
4346 const vector
float *
__b) {
4347 return (vector
float)__builtin_altivec_lvxl(
__a,
__b);
4351 return (vector
float)__builtin_altivec_lvxl(
__a,
__b);
4358 return (vector
signed char)__builtin_altivec_lvxl(
__a,
__b);
4363 return (vector
signed char)__builtin_altivec_lvxl(
__a,
__b);
4368 return (vector
unsigned char)__builtin_altivec_lvxl(
__a,
__b);
4373 return (vector
unsigned char)__builtin_altivec_lvxl(
__a,
__b);
4378 return (vector
bool char)__builtin_altivec_lvxl(
__a,
__b);
4382 const vector
short *
__b) {
4383 return (vector
short)__builtin_altivec_lvxl(
__a,
__b);
4388 return (vector
short)__builtin_altivec_lvxl(
__a,
__b);
4393 return (vector
unsigned short)__builtin_altivec_lvxl(
__a,
__b);
4398 return (vector
unsigned short)__builtin_altivec_lvxl(
__a,
__b);
4403 return (vector
bool short)__builtin_altivec_lvxl(
__a,
__b);
4407 const vector pixel *
__b) {
4408 return (vector pixel)__builtin_altivec_lvxl(
__a,
__b);
4412 const vector
int *
__b) {
4413 return (vector
int)__builtin_altivec_lvxl(
__a,
__b);
4417 return (vector
int)__builtin_altivec_lvxl(
__a,
__b);
4422 return (vector
unsigned int)__builtin_altivec_lvxl(
__a,
__b);
4427 return (vector
unsigned int)__builtin_altivec_lvxl(
__a,
__b);
4432 return (vector
bool int)__builtin_altivec_lvxl(
__a,
__b);
4436 const vector
float *
__b) {
4437 return (vector
float)__builtin_altivec_lvxl(
__a,
__b);
4442 return (vector
float)__builtin_altivec_lvxl(
__a,
__b);
4447 static __inline__ vector
float __attribute__((__always_inline__))
4448 vec_loge(vector
float __a) {
4449 return __builtin_altivec_vlogefp(
__a);
4454 static __inline__ vector
float __attribute__((__always_inline__))
4455 vec_vlogefp(vector
float __a) {
4456 return __builtin_altivec_vlogefp(
__a);
4461 #ifdef __LITTLE_ENDIAN__
4463 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4465 vector
unsigned char mask =
4466 (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4467 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4468 7, 6, 5, 4, 3, 2, 1, 0};
4469 return vec_perm(mask, mask, reverse);
4474 return (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4478 #ifdef __LITTLE_ENDIAN__
4480 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4482 vector
unsigned char mask =
4483 (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4484 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4485 7, 6, 5, 4, 3, 2, 1, 0};
4486 return vec_perm(mask, mask, reverse);
4491 return (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4495 #ifdef __LITTLE_ENDIAN__
4497 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4499 vector
unsigned char mask =
4500 (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4501 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4502 7, 6, 5, 4, 3, 2, 1, 0};
4503 return vec_perm(mask, mask, reverse);
4508 return (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4512 #ifdef __LITTLE_ENDIAN__
4514 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4516 vector
unsigned char mask =
4517 (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4518 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4519 7, 6, 5, 4, 3, 2, 1, 0};
4520 return vec_perm(mask, mask, reverse);
4525 return (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4529 #ifdef __LITTLE_ENDIAN__
4531 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4533 vector
unsigned char mask =
4534 (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4535 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4536 7, 6, 5, 4, 3, 2, 1, 0};
4537 return vec_perm(mask, mask, reverse);
4542 return (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4546 #ifdef __LITTLE_ENDIAN__
4548 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4550 vector
unsigned char mask =
4551 (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4552 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4553 7, 6, 5, 4, 3, 2, 1, 0};
4554 return vec_perm(mask, mask, reverse);
4559 return (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4563 #ifdef __LITTLE_ENDIAN__
4565 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4567 vector
unsigned char mask =
4568 (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4569 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4570 7, 6, 5, 4, 3, 2, 1, 0};
4571 return vec_perm(mask, mask, reverse);
4576 return (vector
unsigned char)__builtin_altivec_lvsl(
__a,
__b);
4582 #ifdef __LITTLE_ENDIAN__
4584 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4586 vector
unsigned char mask =
4587 (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4588 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4589 7, 6, 5, 4, 3, 2, 1, 0};
4590 return vec_perm(mask, mask, reverse);
4595 return (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4599 #ifdef __LITTLE_ENDIAN__
4601 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4603 vector
unsigned char mask =
4604 (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4605 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4606 7, 6, 5, 4, 3, 2, 1, 0};
4607 return vec_perm(mask, mask, reverse);
4612 return (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4616 #ifdef __LITTLE_ENDIAN__
4618 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4620 vector
unsigned char mask =
4621 (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4622 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4623 7, 6, 5, 4, 3, 2, 1, 0};
4624 return vec_perm(mask, mask, reverse);
4629 return (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4633 #ifdef __LITTLE_ENDIAN__
4635 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4637 vector
unsigned char mask =
4638 (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4639 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4640 7, 6, 5, 4, 3, 2, 1, 0};
4641 return vec_perm(mask, mask, reverse);
4646 return (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4650 #ifdef __LITTLE_ENDIAN__
4652 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4654 vector
unsigned char mask =
4655 (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4656 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4657 7, 6, 5, 4, 3, 2, 1, 0};
4658 return vec_perm(mask, mask, reverse);
4663 return (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4667 #ifdef __LITTLE_ENDIAN__
4669 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4671 vector
unsigned char mask =
4672 (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4673 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4674 7, 6, 5, 4, 3, 2, 1, 0};
4675 return vec_perm(mask, mask, reverse);
4680 return (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4684 #ifdef __LITTLE_ENDIAN__
4686 __attribute__((__deprecated__(
"use assignment for unaligned little endian \
4688 vector
unsigned char mask =
4689 (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4690 vector
unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4691 7, 6, 5, 4, 3, 2, 1, 0};
4692 return vec_perm(mask, mask, reverse);
4697 return (vector
unsigned char)__builtin_altivec_lvsr(
__a,
__b);
4703 vec_mladd(vector
signed short, vector
signed short, vector
signed short);
4705 vec_mladd(vector
signed short, vector
unsigned short, vector
unsigned short);
4707 vec_mladd(vector
unsigned short, vector
signed short, vector
signed short);
4709 vec_mladd(vector
unsigned short, vector
unsigned short, vector
unsigned short);
4712 vector
signed short __a, vector
signed short __b, vector
signed short __c) {
4718 vector
unsigned short __c) {
4724 vector
signed short __c) {
4730 vector
unsigned short __c) {
4738 return __builtin_vsx_xvmaddasp(
__a,
__b,
__c);
4740 return __builtin_altivec_vmaddfp(
__a,
__b,
__c);
4747 vector
double __c) {
4748 return __builtin_vsx_xvmaddadp(
__a,
__b,
__c);
4754 static __inline__ vector
float __attribute__((__always_inline__))
4755 vec_vmaddfp(vector
float __a, vector
float __b, vector
float __c) {
4756 return __builtin_altivec_vmaddfp(
__a,
__b,
__c);
4761 static __inline__ vector
signed short __attribute__((__always_inline__))
4762 vec_madds(vector
signed short __a, vector
signed short __b,
4763 vector
signed short __c) {
4764 return __builtin_altivec_vmhaddshs(
__a,
__b,
__c);
4768 static __inline__ vector
signed short __attribute__((__always_inline__))
4769 vec_vmhaddshs(vector
signed short __a, vector
signed short __b,
4770 vector
signed short __c) {
4771 return __builtin_altivec_vmhaddshs(
__a,
__b,
__c);
4777 static __inline__ vector
float __ATTRS_o_ai vec_msub(vector
float __a,
4780 return __builtin_vsx_xvmsubasp(
__a,
__b,
__c);
4783 static __inline__ vector
double __ATTRS_o_ai vec_msub(vector
double __a,
4785 vector
double __c) {
4786 return __builtin_vsx_xvmsubadp(
__a,
__b,
__c);
4794 return __builtin_altivec_vmaxsb(
__a,
__b);
4799 return __builtin_altivec_vmaxsb((vector
signed char)
__a,
__b);
4804 return __builtin_altivec_vmaxsb(
__a, (vector
signed char)
__b);
4809 return __builtin_altivec_vmaxub(
__a,
__b);
4814 return __builtin_altivec_vmaxub((vector
unsigned char)
__a,
__b);
4819 return __builtin_altivec_vmaxub(
__a, (vector
unsigned char)
__b);
4824 return __builtin_altivec_vmaxsh(
__a,
__b);
4829 return __builtin_altivec_vmaxsh((vector
short)
__a,
__b);
4833 vector
bool short __b) {
4834 return __builtin_altivec_vmaxsh(
__a, (vector
short)
__b);
4839 return __builtin_altivec_vmaxuh(
__a,
__b);
4844 return __builtin_altivec_vmaxuh((vector
unsigned short)
__a,
__b);
4849 return __builtin_altivec_vmaxuh(
__a, (vector
unsigned short)
__b);
4854 return __builtin_altivec_vmaxsw(
__a,
__b);
4859 return __builtin_altivec_vmaxsw((vector
int)
__a,
__b);
4863 vector
bool int __b) {
4864 return __builtin_altivec_vmaxsw(
__a, (vector
int)
__b);
4869 return __builtin_altivec_vmaxuw(
__a,
__b);
4874 return __builtin_altivec_vmaxuw((vector
unsigned int)
__a,
__b);
4879 return __builtin_altivec_vmaxuw(
__a, (vector
unsigned int)
__b);
4882 #ifdef __POWER8_VECTOR__
4884 vec_max(vector
signed long long __a, vector
signed long long __b) {
4885 return __builtin_altivec_vmaxsd(
__a,
__b);
4889 vec_max(vector
bool long long __a, vector
signed long long __b) {
4890 return __builtin_altivec_vmaxsd((vector
signed long long)
__a,
__b);
4894 vec_max(vector
signed long long __a, vector
bool long long __b) {
4895 return __builtin_altivec_vmaxsd(
__a, (vector
signed long long)
__b);
4898 static __inline__ vector
unsigned long long __ATTRS_o_ai
4899 vec_max(vector
unsigned long long __a, vector
unsigned long long __b) {
4900 return __builtin_altivec_vmaxud(
__a,
__b);
4903 static __inline__ vector
unsigned long long __ATTRS_o_ai
4904 vec_max(vector
bool long long __a, vector
unsigned long long __b) {
4905 return __builtin_altivec_vmaxud((vector
unsigned long long)
__a,
__b);
4908 static __inline__ vector
unsigned long long __ATTRS_o_ai
4909 vec_max(vector
unsigned long long __a, vector
bool long long __b) {
4910 return __builtin_altivec_vmaxud(
__a, (vector
unsigned long long)
__b);
4917 return __builtin_vsx_xvmaxsp(
__a,
__b);
4919 return __builtin_altivec_vmaxfp(
__a,
__b);
4925 vector
double __b) {
4926 return __builtin_vsx_xvmaxdp(
__a,
__b);
4934 return __builtin_altivec_vmaxsb(
__a,
__b);
4939 return __builtin_altivec_vmaxsb((vector
signed char)
__a,
__b);
4944 return __builtin_altivec_vmaxsb(
__a, (vector
signed char)
__b);
4951 return __builtin_altivec_vmaxub(
__a,
__b);
4956 return __builtin_altivec_vmaxub((vector
unsigned char)
__a,
__b);
4961 return __builtin_altivec_vmaxub(
__a, (vector
unsigned char)
__b);
4968 return __builtin_altivec_vmaxsh(
__a,
__b);
4973 return __builtin_altivec_vmaxsh((vector
short)
__a,
__b);
4977 vector
bool short __b) {
4978 return __builtin_altivec_vmaxsh(
__a, (vector
short)
__b);
4985 return __builtin_altivec_vmaxuh(
__a,
__b);
4990 return __builtin_altivec_vmaxuh((vector
unsigned short)
__a,
__b);
4995 return __builtin_altivec_vmaxuh(
__a, (vector
unsigned short)
__b);
5002 return __builtin_altivec_vmaxsw(
__a,
__b);
5007 return __builtin_altivec_vmaxsw((vector
int)
__a,
__b);
5011 vector
bool int __b) {
5012 return __builtin_altivec_vmaxsw(
__a, (vector
int)
__b);
5019 return __builtin_altivec_vmaxuw(
__a,
__b);
5024 return __builtin_altivec_vmaxuw((vector
unsigned int)
__a,
__b);
5029 return __builtin_altivec_vmaxuw(
__a, (vector
unsigned int)
__b);
5034 static __inline__ vector
float __attribute__((__always_inline__))
5035 vec_vmaxfp(vector
float __a, vector
float __b) {
5037 return __builtin_vsx_xvmaxsp(
__a,
__b);
5039 return __builtin_altivec_vmaxfp(
__a,
__b);
5048 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5049 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5050 0x06, 0x16, 0x07, 0x17));
5056 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5057 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5058 0x06, 0x16, 0x07, 0x17));
5064 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5065 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5066 0x06, 0x16, 0x07, 0x17));
5072 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5073 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5074 0x06, 0x07, 0x16, 0x17));
5080 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5081 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5082 0x06, 0x07, 0x16, 0x17));
5088 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5089 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5090 0x06, 0x07, 0x16, 0x17));
5096 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5097 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5098 0x06, 0x07, 0x16, 0x17));
5104 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5105 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5106 0x14, 0x15, 0x16, 0x17));
5112 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5113 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5114 0x14, 0x15, 0x16, 0x17));
5118 vector
bool int __b) {
5120 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5121 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5122 0x14, 0x15, 0x16, 0x17));
5128 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5129 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5130 0x14, 0x15, 0x16, 0x17));
5137 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5138 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5139 0x14, 0x15, 0x16, 0x17));
5145 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5146 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5147 0x14, 0x15, 0x16, 0x17));
5153 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5154 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5155 0x14, 0x15, 0x16, 0x17));
5158 static __inline__ vector
unsigned long long __ATTRS_o_ai
5161 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5162 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5163 0x14, 0x15, 0x16, 0x17));
5166 static __inline__ vector
unsigned long long __ATTRS_o_ai
5169 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5170 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5171 0x14, 0x15, 0x16, 0x17));
5174 static __inline__ vector
unsigned long long __ATTRS_o_ai
5177 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5178 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5179 0x14, 0x15, 0x16, 0x17));
5185 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5186 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5187 0x14, 0x15, 0x16, 0x17));
5191 vector
double __b) {
5193 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5194 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5195 0x14, 0x15, 0x16, 0x17));
5200 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5201 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5202 0x14, 0x15, 0x16, 0x17));
5207 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5208 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5209 0x14, 0x15, 0x16, 0x17));
5215 #define __builtin_altivec_vmrghb vec_vmrghb
5220 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5221 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5222 0x06, 0x16, 0x07, 0x17));
5228 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5229 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5230 0x06, 0x16, 0x07, 0x17));
5236 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5237 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5238 0x06, 0x16, 0x07, 0x17));
5243 #define __builtin_altivec_vmrghh vec_vmrghh
5248 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5249 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5250 0x06, 0x07, 0x16, 0x17));
5256 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5257 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5258 0x06, 0x07, 0x16, 0x17));
5264 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5265 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5266 0x06, 0x07, 0x16, 0x17));
5272 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5273 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5274 0x06, 0x07, 0x16, 0x17));
5279 #define __builtin_altivec_vmrghw vec_vmrghw
5284 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5285 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5286 0x14, 0x15, 0x16, 0x17));
5292 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5293 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5294 0x14, 0x15, 0x16, 0x17));
5298 vector
bool int __b) {
5300 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5301 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5302 0x14, 0x15, 0x16, 0x17));
5308 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5309 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5310 0x14, 0x15, 0x16, 0x17));
5318 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5319 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5320 0x0E, 0x1E, 0x0F, 0x1F));
5326 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5327 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5328 0x0E, 0x1E, 0x0F, 0x1F));
5334 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5335 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5336 0x0E, 0x1E, 0x0F, 0x1F));
5342 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5343 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5344 0x0E, 0x0F, 0x1E, 0x1F));
5350 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5351 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5352 0x0E, 0x0F, 0x1E, 0x1F));
5358 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5359 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5360 0x0E, 0x0F, 0x1E, 0x1F));
5366 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5367 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5368 0x0E, 0x0F, 0x1E, 0x1F));
5374 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5375 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5376 0x1C, 0x1D, 0x1E, 0x1F));
5382 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5383 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5384 0x1C, 0x1D, 0x1E, 0x1F));
5388 vector
bool int __b) {
5390 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5391 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5392 0x1C, 0x1D, 0x1E, 0x1F));
5398 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5399 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5400 0x1C, 0x1D, 0x1E, 0x1F));
5407 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5408 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5409 0x1C, 0x1D, 0x1E, 0x1F));
5414 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5415 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5416 0x1C, 0x1D, 0x1E, 0x1F));
5421 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5422 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5423 0x1C, 0x1D, 0x1E, 0x1F));
5425 static __inline__ vector
unsigned long long __ATTRS_o_ai
5428 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5429 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5430 0x1C, 0x1D, 0x1E, 0x1F));
5432 static __inline__ vector
unsigned long long __ATTRS_o_ai
5435 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5436 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5437 0x1C, 0x1D, 0x1E, 0x1F));
5439 static __inline__ vector
unsigned long long __ATTRS_o_ai
5442 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5443 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5444 0x1C, 0x1D, 0x1E, 0x1F));
5449 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5450 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5451 0x1C, 0x1D, 0x1E, 0x1F));
5454 vector
double __b) {
5456 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5457 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5458 0x1C, 0x1D, 0x1E, 0x1F));
5463 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5464 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5465 0x1C, 0x1D, 0x1E, 0x1F));
5470 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5471 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5472 0x1C, 0x1D, 0x1E, 0x1F));
5478 #define __builtin_altivec_vmrglb vec_vmrglb
5483 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5484 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5485 0x0E, 0x1E, 0x0F, 0x1F));
5491 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5492 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5493 0x0E, 0x1E, 0x0F, 0x1F));
5499 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5500 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5501 0x0E, 0x1E, 0x0F, 0x1F));
5506 #define __builtin_altivec_vmrglh vec_vmrglh
5511 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5512 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5513 0x0E, 0x0F, 0x1E, 0x1F));
5519 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5520 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5521 0x0E, 0x0F, 0x1E, 0x1F));
5527 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5528 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5529 0x0E, 0x0F, 0x1E, 0x1F));
5535 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5536 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5537 0x0E, 0x0F, 0x1E, 0x1F));
5542 #define __builtin_altivec_vmrglw vec_vmrglw
5547 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5548 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5549 0x1C, 0x1D, 0x1E, 0x1F));
5555 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5556 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5557 0x1C, 0x1D, 0x1E, 0x1F));
5561 vector
bool int __b) {
5563 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5564 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5565 0x1C, 0x1D, 0x1E, 0x1F));
5571 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5572 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5573 0x1C, 0x1D, 0x1E, 0x1F));
5576 #ifdef __POWER8_VECTOR__
5579 static __inline__ vector
bool int __ATTRS_o_ai vec_mergee(vector
bool int __a,
5580 vector
bool int __b) {
5582 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5583 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5584 0x18, 0x19, 0x1A, 0x1B));
5588 vec_mergee(vector
signed int __a, vector
signed int __b) {
5590 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5591 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5592 0x18, 0x19, 0x1A, 0x1B));
5596 vec_mergee(vector
unsigned int __a, vector
unsigned int __b) {
5598 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5599 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5600 0x18, 0x19, 0x1A, 0x1B));
5604 vec_mergee(vector
bool long long __a, vector
bool long long __b) {
5609 vec_mergee(vector
signed long long __a, vector
signed long long __b) {
5613 static __inline__ vector
unsigned long long __ATTRS_o_ai
5614 vec_mergee(vector
unsigned long long __a, vector
unsigned long long __b) {
5619 vec_mergee(vector
float __a, vector
float __b) {
5621 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5622 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5623 0x18, 0x19, 0x1A, 0x1B));
5627 vec_mergee(vector
double __a, vector
double __b) {
5633 static __inline__ vector
bool int __ATTRS_o_ai vec_mergeo(vector
bool int __a,
5634 vector
bool int __b) {
5636 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5637 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5638 0x1C, 0x1D, 0x1E, 0x1F));
5642 vec_mergeo(vector
signed int __a, vector
signed int __b) {
5644 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5645 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5646 0x1C, 0x1D, 0x1E, 0x1F));
5650 vec_mergeo(vector
unsigned int __a, vector
unsigned int __b) {
5652 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5653 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5654 0x1C, 0x1D, 0x1E, 0x1F));
5658 vec_mergeo(vector
bool long long __a, vector
bool long long __b) {
5663 vec_mergeo(vector
signed long long __a, vector
signed long long __b) {
5667 static __inline__ vector
unsigned long long __ATTRS_o_ai
5668 vec_mergeo(vector
unsigned long long __a, vector
unsigned long long __b) {
5673 vec_mergeo(vector
float __a, vector
float __b) {
5675 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5676 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5677 0x1C, 0x1D, 0x1E, 0x1F));
5681 vec_mergeo(vector
double __a, vector
double __b) {
5689 static __inline__ vector
unsigned short __attribute__((__always_inline__))
5691 return __builtin_altivec_mfvscr();
5698 return __builtin_altivec_vminsb(
__a,
__b);
5703 return __builtin_altivec_vminsb((vector
signed char)
__a,
__b);
5708 return __builtin_altivec_vminsb(
__a, (vector
signed char)
__b);
5713 return __builtin_altivec_vminub(
__a,
__b);
5718 return __builtin_altivec_vminub((vector
unsigned char)
__a,
__b);
5723 return __builtin_altivec_vminub(
__a, (vector
unsigned char)
__b);
5728 return __builtin_altivec_vminsh(
__a,
__b);
5733 return __builtin_altivec_vminsh((vector
short)
__a,
__b);
5737 vector
bool short __b) {
5738 return __builtin_altivec_vminsh(
__a, (vector
short)
__b);
5743 return __builtin_altivec_vminuh(
__a,
__b);
5748 return __builtin_altivec_vminuh((vector
unsigned short)
__a,
__b);
5753 return __builtin_altivec_vminuh(
__a, (vector
unsigned short)
__b);
5758 return __builtin_altivec_vminsw(
__a,
__b);
5763 return __builtin_altivec_vminsw((vector
int)
__a,
__b);
5767 vector
bool int __b) {
5768 return __builtin_altivec_vminsw(
__a, (vector
int)
__b);
5773 return __builtin_altivec_vminuw(
__a,
__b);
5778 return __builtin_altivec_vminuw((vector
unsigned int)
__a,
__b);
5783 return __builtin_altivec_vminuw(
__a, (vector
unsigned int)
__b);
5786 #ifdef __POWER8_VECTOR__
5788 vec_min(vector
signed long long __a, vector
signed long long __b) {
5789 return __builtin_altivec_vminsd(
__a,
__b);
5793 vec_min(vector
bool long long __a, vector
signed long long __b) {
5794 return __builtin_altivec_vminsd((vector
signed long long)
__a,
__b);
5798 vec_min(vector
signed long long __a, vector
bool long long __b) {
5799 return __builtin_altivec_vminsd(
__a, (vector
signed long long)
__b);
5802 static __inline__ vector
unsigned long long __ATTRS_o_ai
5803 vec_min(vector
unsigned long long __a, vector
unsigned long long __b) {
5804 return __builtin_altivec_vminud(
__a,
__b);
5807 static __inline__ vector
unsigned long long __ATTRS_o_ai
5808 vec_min(vector
bool long long __a, vector
unsigned long long __b) {
5809 return __builtin_altivec_vminud((vector
unsigned long long)
__a,
__b);
5812 static __inline__ vector
unsigned long long __ATTRS_o_ai
5813 vec_min(vector
unsigned long long __a, vector
bool long long __b) {
5814 return __builtin_altivec_vminud(
__a, (vector
unsigned long long)
__b);
5821 return __builtin_vsx_xvminsp(
__a,
__b);
5823 return __builtin_altivec_vminfp(
__a,
__b);
5829 vector
double __b) {
5830 return __builtin_vsx_xvmindp(
__a,
__b);
5838 return __builtin_altivec_vminsb(
__a,
__b);
5843 return __builtin_altivec_vminsb((vector
signed char)
__a,
__b);
5848 return __builtin_altivec_vminsb(
__a, (vector
signed char)
__b);
5855 return __builtin_altivec_vminub(
__a,
__b);
5860 return __builtin_altivec_vminub((vector
unsigned char)
__a,
__b);
5865 return __builtin_altivec_vminub(
__a, (vector
unsigned char)
__b);
5872 return __builtin_altivec_vminsh(
__a,
__b);
5877 return __builtin_altivec_vminsh((vector
short)
__a,
__b);
5881 vector
bool short __b) {
5882 return __builtin_altivec_vminsh(
__a, (vector
short)
__b);
5889 return __builtin_altivec_vminuh(
__a,
__b);
5894 return __builtin_altivec_vminuh((vector
unsigned short)
__a,
__b);
5899 return __builtin_altivec_vminuh(
__a, (vector
unsigned short)
__b);
5906 return __builtin_altivec_vminsw(
__a,
__b);
5911 return __builtin_altivec_vminsw((vector
int)
__a,
__b);
5915 vector
bool int __b) {
5916 return __builtin_altivec_vminsw(
__a, (vector
int)
__b);
5923 return __builtin_altivec_vminuw(
__a,
__b);
5928 return __builtin_altivec_vminuw((vector
unsigned int)
__a,
__b);
5933 return __builtin_altivec_vminuw(
__a, (vector
unsigned int)
__b);
5938 static __inline__ vector
float __attribute__((__always_inline__))
5939 vec_vminfp(vector
float __a, vector
float __b) {
5941 return __builtin_vsx_xvminsp(
__a,
__b);
5943 return __builtin_altivec_vminfp(
__a,
__b);
5949 #define __builtin_altivec_vmladduhm vec_mladd
5958 vector
short __a, vector
unsigned short __b, vector
unsigned short __c) {
5959 return __a * (vector short)
__b + (vector
short)
__c;
5970 vector
unsigned short __c) {
5983 vector
short __a, vector
unsigned short __b, vector
unsigned short __c) {
5984 return __a * (vector short)
__b + (vector
short)
__c;
5994 vector
unsigned short __c) {
6000 static __inline__ vector
short __attribute__((__always_inline__))
6001 vec_mradds(vector
short __a, vector
short __b, vector
short __c) {
6002 return __builtin_altivec_vmhraddshs(
__a,
__b,
__c);
6007 static __inline__ vector
short __attribute__((__always_inline__))
6008 vec_vmhraddshs(vector
short __a, vector
short __b, vector
short __c) {
6009 return __builtin_altivec_vmhraddshs(
__a,
__b,
__c);
6015 vector
unsigned char __b,
6017 return __builtin_altivec_vmsummbm(
__a,
__b,
__c);
6022 vector
unsigned int __c) {
6023 return __builtin_altivec_vmsumubm(
__a,
__b,
__c);
6029 return __builtin_altivec_vmsumshm(
__a,
__b,
__c);
6034 vector
unsigned int __c) {
6035 return __builtin_altivec_vmsumuhm(
__a,
__b,
__c);
6040 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6041 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
6042 vec_msumc(vector
unsigned long long __a, vector
unsigned long long __b,
6043 vector
unsigned __int128
__c) {
6044 return __builtin_altivec_vmsumcud(
__a,
__b,
__c);
6050 static __inline__ vector
int __attribute__((__always_inline__))
6051 vec_vmsummbm(vector
signed char __a, vector
unsigned char __b, vector
int __c) {
6052 return __builtin_altivec_vmsummbm(
__a,
__b,
__c);
6057 static __inline__ vector
unsigned int __attribute__((__always_inline__))
6058 vec_vmsumubm(vector
unsigned char __a, vector
unsigned char __b,
6059 vector
unsigned int __c) {
6060 return __builtin_altivec_vmsumubm(
__a,
__b,
__c);
6065 static __inline__ vector
int __attribute__((__always_inline__))
6066 vec_vmsumshm(vector
short __a, vector
short __b, vector
int __c) {
6067 return __builtin_altivec_vmsumshm(
__a,
__b,
__c);
6072 static __inline__ vector
unsigned int __attribute__((__always_inline__))
6073 vec_vmsumuhm(vector
unsigned short __a, vector
unsigned short __b,
6074 vector
unsigned int __c) {
6075 return __builtin_altivec_vmsumuhm(
__a,
__b,
__c);
6083 return __builtin_altivec_vmsumshs(
__a,
__b,
__c);
6088 vector
unsigned int __c) {
6089 return __builtin_altivec_vmsumuhs(
__a,
__b,
__c);
6094 static __inline__ vector
int __attribute__((__always_inline__))
6095 vec_vmsumshs(vector
short __a, vector
short __b, vector
int __c) {
6096 return __builtin_altivec_vmsumshs(
__a,
__b,
__c);
6101 static __inline__ vector
unsigned int __attribute__((__always_inline__))
6102 vec_vmsumuhs(vector
unsigned short __a, vector
unsigned short __b,
6103 vector
unsigned int __c) {
6104 return __builtin_altivec_vmsumuhs(
__a,
__b,
__c);
6110 __builtin_altivec_mtvscr((vector
int)
__a);
6114 __builtin_altivec_mtvscr((vector
int)
__a);
6118 __builtin_altivec_mtvscr((vector
int)
__a);
6122 __builtin_altivec_mtvscr((vector
int)
__a);
6126 __builtin_altivec_mtvscr((vector
int)
__a);
6130 __builtin_altivec_mtvscr((vector
int)
__a);
6134 __builtin_altivec_mtvscr((vector
int)
__a);
6138 __builtin_altivec_mtvscr((vector
int)
__a);
6142 __builtin_altivec_mtvscr((vector
int)
__a);
6146 __builtin_altivec_mtvscr((vector
int)
__a);
6150 __builtin_altivec_mtvscr((vector
int)
__a);
6191 vec_mul(vector
signed long long __a, vector
signed long long __b) {
6195 static __inline__ vector
unsigned long long __ATTRS_o_ai
6196 vec_mul(vector
unsigned long long __a, vector
unsigned long long __b) {
6208 vector
double __b) {
6219 vector
signed char __b) {
6220 #ifdef __LITTLE_ENDIAN__
6221 return __builtin_altivec_vmulosb(
__a,
__b);
6223 return __builtin_altivec_vmulesb(
__a,
__b);
6229 #ifdef __LITTLE_ENDIAN__
6230 return __builtin_altivec_vmuloub(
__a,
__b);
6232 return __builtin_altivec_vmuleub(
__a,
__b);
6238 #ifdef __LITTLE_ENDIAN__
6239 return __builtin_altivec_vmulosh(
__a,
__b);
6241 return __builtin_altivec_vmulesh(
__a,
__b);
6247 #ifdef __LITTLE_ENDIAN__
6248 return __builtin_altivec_vmulouh(
__a,
__b);
6250 return __builtin_altivec_vmuleuh(
__a,
__b);
6254 #ifdef __POWER8_VECTOR__
6257 #ifdef __LITTLE_ENDIAN__
6258 return __builtin_altivec_vmulosw(
__a,
__b);
6260 return __builtin_altivec_vmulesw(
__a,
__b);
6264 static __inline__ vector
unsigned long long __ATTRS_o_ai
6266 #ifdef __LITTLE_ENDIAN__
6267 return __builtin_altivec_vmulouw(
__a,
__b);
6269 return __builtin_altivec_vmuleuw(
__a,
__b);
6274 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6276 vec_mule(vector
signed long long __a, vector
signed long long __b) {
6277 #ifdef __LITTLE_ENDIAN__
6278 return __builtin_altivec_vmulosd(
__a,
__b);
6280 return __builtin_altivec_vmulesd(
__a,
__b);
6284 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
6285 vec_mule(vector
unsigned long long __a, vector
unsigned long long __b) {
6286 #ifdef __LITTLE_ENDIAN__
6287 return __builtin_altivec_vmuloud(
__a,
__b);
6289 return __builtin_altivec_vmuleud(
__a,
__b);
6296 static __inline__ vector
short __attribute__((__always_inline__))
6297 vec_vmulesb(vector
signed char __a, vector
signed char __b) {
6298 #ifdef __LITTLE_ENDIAN__
6299 return __builtin_altivec_vmulosb(
__a,
__b);
6301 return __builtin_altivec_vmulesb(
__a,
__b);
6307 static __inline__ vector
unsigned short __attribute__((__always_inline__))
6308 vec_vmuleub(vector
unsigned char __a, vector
unsigned char __b) {
6309 #ifdef __LITTLE_ENDIAN__
6310 return __builtin_altivec_vmuloub(
__a,
__b);
6312 return __builtin_altivec_vmuleub(
__a,
__b);
6318 static __inline__ vector
int __attribute__((__always_inline__))
6319 vec_vmulesh(vector
short __a, vector
short __b) {
6320 #ifdef __LITTLE_ENDIAN__
6321 return __builtin_altivec_vmulosh(
__a,
__b);
6323 return __builtin_altivec_vmulesh(
__a,
__b);
6329 static __inline__ vector
unsigned int __attribute__((__always_inline__))
6330 vec_vmuleuh(vector
unsigned short __a, vector
unsigned short __b) {
6331 #ifdef __LITTLE_ENDIAN__
6332 return __builtin_altivec_vmulouh(
__a,
__b);
6334 return __builtin_altivec_vmuleuh(
__a,
__b);
6340 #ifdef __POWER10_VECTOR__
6342 vec_mulh(vector
signed int __a, vector
signed int __b) {
6343 return __builtin_altivec_vmulhsw(
__a,
__b);
6347 vec_mulh(vector
unsigned int __a, vector
unsigned int __b) {
6348 return __builtin_altivec_vmulhuw(
__a,
__b);
6352 vec_mulh(vector
signed long long __a, vector
signed long long __b) {
6353 return __builtin_altivec_vmulhsd(
__a,
__b);
6356 static __inline__ vector
unsigned long long __ATTRS_o_ai
6357 vec_mulh(vector
unsigned long long __a, vector
unsigned long long __b) {
6358 return __builtin_altivec_vmulhud(
__a,
__b);
6365 vector
signed char __b) {
6366 #ifdef __LITTLE_ENDIAN__
6367 return __builtin_altivec_vmulesb(
__a,
__b);
6369 return __builtin_altivec_vmulosb(
__a,
__b);
6375 #ifdef __LITTLE_ENDIAN__
6376 return __builtin_altivec_vmuleub(
__a,
__b);
6378 return __builtin_altivec_vmuloub(
__a,
__b);
6384 #ifdef __LITTLE_ENDIAN__
6385 return __builtin_altivec_vmulesh(
__a,
__b);
6387 return __builtin_altivec_vmulosh(
__a,
__b);
6393 #ifdef __LITTLE_ENDIAN__
6394 return __builtin_altivec_vmuleuh(
__a,
__b);
6396 return __builtin_altivec_vmulouh(
__a,
__b);
6400 #ifdef __POWER8_VECTOR__
6403 #ifdef __LITTLE_ENDIAN__
6404 return __builtin_altivec_vmulesw(
__a,
__b);
6406 return __builtin_altivec_vmulosw(
__a,
__b);
6410 static __inline__ vector
unsigned long long __ATTRS_o_ai
6412 #ifdef __LITTLE_ENDIAN__
6413 return __builtin_altivec_vmuleuw(
__a,
__b);
6415 return __builtin_altivec_vmulouw(
__a,
__b);
6420 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6422 vec_mulo(vector
signed long long __a, vector
signed long long __b) {
6423 #ifdef __LITTLE_ENDIAN__
6424 return __builtin_altivec_vmulesd(
__a,
__b);
6426 return __builtin_altivec_vmulosd(
__a,
__b);
6430 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
6431 vec_mulo(vector
unsigned long long __a, vector
unsigned long long __b) {
6432 #ifdef __LITTLE_ENDIAN__
6433 return __builtin_altivec_vmuleud(
__a,
__b);
6435 return __builtin_altivec_vmuloud(
__a,
__b);
6442 static __inline__ vector
short __attribute__((__always_inline__))
6443 vec_vmulosb(vector
signed char __a, vector
signed char __b) {
6444 #ifdef __LITTLE_ENDIAN__
6445 return __builtin_altivec_vmulesb(
__a,
__b);
6447 return __builtin_altivec_vmulosb(
__a,
__b);
6453 static __inline__ vector
unsigned short __attribute__((__always_inline__))
6454 vec_vmuloub(vector
unsigned char __a, vector
unsigned char __b) {
6455 #ifdef __LITTLE_ENDIAN__
6456 return __builtin_altivec_vmuleub(
__a,
__b);
6458 return __builtin_altivec_vmuloub(
__a,
__b);
6464 static __inline__ vector
int __attribute__((__always_inline__))
6465 vec_vmulosh(vector
short __a, vector
short __b) {
6466 #ifdef __LITTLE_ENDIAN__
6467 return __builtin_altivec_vmulesh(
__a,
__b);
6469 return __builtin_altivec_vmulosh(
__a,
__b);
6475 static __inline__ vector
unsigned int __attribute__((__always_inline__))
6476 vec_vmulouh(vector
unsigned short __a, vector
unsigned short __b) {
6477 #ifdef __LITTLE_ENDIAN__
6478 return __builtin_altivec_vmuleuh(
__a,
__b);
6480 return __builtin_altivec_vmulouh(
__a,
__b);
6486 #ifdef __POWER8_VECTOR__
6488 vec_nand(vector
signed char __a, vector
signed char __b) {
6493 vec_nand(vector
signed char __a, vector
bool char __b) {
6498 vec_nand(vector
bool char __a, vector
signed char __b) {
6503 vec_nand(vector
unsigned char __a, vector
unsigned char __b) {
6508 vec_nand(vector
unsigned char __a, vector
bool char __b) {
6513 vec_nand(vector
bool char __a, vector
unsigned char __b) {
6517 static __inline__ vector
bool char __ATTRS_o_ai vec_nand(vector
bool char __a,
6518 vector
bool char __b) {
6523 vec_nand(vector
signed short __a, vector
signed short __b) {
6528 vec_nand(vector
signed short __a, vector
bool short __b) {
6533 vec_nand(vector
bool short __a, vector
signed short __b) {
6538 vec_nand(vector
unsigned short __a, vector
unsigned short __b) {
6543 vec_nand(vector
unsigned short __a, vector
bool short __b) {
6548 vec_nand(vector
bool short __a, vector
bool short __b) {
6553 vec_nand(vector
signed int __a, vector
signed int __b) {
6557 static __inline__ vector
signed int __ATTRS_o_ai vec_nand(vector
signed int __a,
6558 vector
bool int __b) {
6563 vec_nand(vector
bool int __a, vector
signed int __b) {
6568 vec_nand(vector
unsigned int __a, vector
unsigned int __b) {
6573 vec_nand(vector
unsigned int __a, vector
bool int __b) {
6578 vec_nand(vector
bool int __a, vector
unsigned int __b) {
6582 static __inline__ vector
bool int __ATTRS_o_ai vec_nand(vector
bool int __a,
6583 vector
bool int __b) {
6588 vec_nand(vector
float __a, vector
float __b) {
6589 return (vector
float)(~((vector
unsigned int)
__a &
6590 (vector
unsigned int)
__b));
6594 vec_nand(vector
signed long long __a, vector
signed long long __b) {
6599 vec_nand(vector
signed long long __a, vector
bool long long __b) {
6604 vec_nand(vector
bool long long __a, vector
signed long long __b) {
6608 static __inline__ vector
unsigned long long __ATTRS_o_ai
6609 vec_nand(vector
unsigned long long __a, vector
unsigned long long __b) {
6613 static __inline__ vector
unsigned long long __ATTRS_o_ai
6614 vec_nand(vector
unsigned long long __a, vector
bool long long __b) {
6618 static __inline__ vector
unsigned long long __ATTRS_o_ai
6619 vec_nand(vector
bool long long __a, vector
unsigned long long __b) {
6624 vec_nand(vector
bool long long __a, vector
bool long long __b) {
6629 vec_nand(vector
double __a, vector
double __b) {
6630 return (vector
double)(~((vector
unsigned long long)
__a &
6631 (vector
unsigned long long)
__b));
6639 static __inline__ vector
float __ATTRS_o_ai vec_nmadd(vector
float __a,
6642 return __builtin_vsx_xvnmaddasp(
__a,
__b,
__c);
6645 static __inline__ vector
double __ATTRS_o_ai vec_nmadd(vector
double __a,
6647 vector
double __c) {
6648 return __builtin_vsx_xvnmaddadp(
__a,
__b,
__c);
6658 return __builtin_vsx_xvnmsubasp(
__a,
__b,
__c);
6660 return __builtin_altivec_vnmsubfp(
__a,
__b,
__c);
6667 vector
double __c) {
6668 return __builtin_vsx_xvnmsubadp(
__a,
__b,
__c);
6674 static __inline__ vector
float __attribute__((__always_inline__))
6675 vec_vnmsubfp(vector
float __a, vector
float __b, vector
float __c) {
6676 return __builtin_altivec_vnmsubfp(
__a,
__b,
__c);
6681 #define __builtin_altivec_vnor vec_nor
6694 vector
bool char __b) {
6724 vector
bool int __b) {
6730 vector
unsigned int __res =
6731 ~((vector
unsigned int)
__a | (vector
unsigned int)
__b);
6732 return (vector
float)__res;
6737 vector
double __b) {
6738 vector
unsigned long long __res =
6739 ~((vector
unsigned long long)
__a | (vector
unsigned long long)
__b);
6740 return (vector
double)__res;
6757 vector
bool char __b) {
6787 vector
bool int __b) {
6793 vector
unsigned int __res =
6794 ~((vector
unsigned int)
__a | (vector
unsigned int)
__b);
6795 return (vector
float)__res;
6800 vec_nor(vector
signed long long __a, vector
signed long long __b) {
6804 static __inline__ vector
unsigned long long __ATTRS_o_ai
6805 vec_nor(vector
unsigned long long __a, vector
unsigned long long __b) {
6810 vec_nor(vector
bool long long __a, vector
bool long long __b) {
6817 #define __builtin_altivec_vor vec_or
6826 return (vector
signed char)
__a |
__b;
6830 vector
bool char __b) {
6831 return __a | (vector
signed char)
__b;
6841 return (vector
unsigned char)
__a |
__b;
6846 return __a | (vector
unsigned char)
__b;
6850 vector
bool char __b) {
6861 return (vector
short)
__a |
__b;
6865 vector
bool short __b) {
6866 return __a | (vector short)
__b;
6876 return (vector
unsigned short)
__a |
__b;
6881 return __a | (vector
unsigned short)
__b;
6885 vector
bool short __b) {
6896 return (vector
int)
__a |
__b;
6900 vector
bool int __b) {
6911 return (vector
unsigned int)
__a |
__b;
6920 vector
bool int __b) {
6926 vector
unsigned int __res =
6927 (vector
unsigned int)
__a | (vector
unsigned int)
__b;
6928 return (vector
float)__res;
6933 vector
unsigned int __res =
6934 (vector
unsigned int)
__a | (vector
unsigned int)
__b;
6935 return (vector
float)__res;
6939 vector
bool int __b) {
6940 vector
unsigned int __res =
6941 (vector
unsigned int)
__a | (vector
unsigned int)
__b;
6942 return (vector
float)__res;
6947 vector
double __b) {
6948 return (vector
double)((vector
unsigned long long)
__a |
6949 (vector
unsigned long long)
__b);
6953 vector
bool long long __b) {
6954 return (vector
double)((vector
unsigned long long)
__a |
6955 (vector
unsigned long long)
__b);
6959 vector
double __b) {
6960 return (vector
double)((vector
unsigned long long)
__a |
6961 (vector
unsigned long long)
__b);
6965 vec_or(vector
signed long long __a, vector
signed long long __b) {
6970 vec_or(vector
bool long long __a, vector
signed long long __b) {
6971 return (vector
signed long long)
__a |
__b;
6975 vec_or(vector
signed long long __a, vector
bool long long __b) {
6976 return __a | (vector
signed long long)
__b;
6979 static __inline__ vector
unsigned long long __ATTRS_o_ai
6980 vec_or(vector
unsigned long long __a, vector
unsigned long long __b) {
6984 static __inline__ vector
unsigned long long __ATTRS_o_ai
6985 vec_or(vector
bool long long __a, vector
unsigned long long __b) {
6986 return (vector
unsigned long long)
__a |
__b;
6989 static __inline__ vector
unsigned long long __ATTRS_o_ai
6990 vec_or(vector
unsigned long long __a, vector
bool long long __b) {
6991 return __a | (vector
unsigned long long)
__b;
6995 vec_or(vector
bool long long __a, vector
bool long long __b) {
7000 #ifdef __POWER8_VECTOR__
7002 vec_orc(vector
signed char __a, vector
signed char __b) {
7007 vec_orc(vector
signed char __a, vector
bool char __b) {
7012 vec_orc(vector
bool char __a, vector
signed char __b) {
7017 vec_orc(vector
unsigned char __a, vector
unsigned char __b) {
7022 vec_orc(vector
unsigned char __a, vector
bool char __b) {
7027 vec_orc(vector
bool char __a, vector
unsigned char __b) {
7031 static __inline__ vector
bool char __ATTRS_o_ai vec_orc(vector
bool char __a,
7032 vector
bool char __b) {
7037 vec_orc(vector
signed short __a, vector
signed short __b) {
7042 vec_orc(vector
signed short __a, vector
bool short __b) {
7047 vec_orc(vector
bool short __a, vector
signed short __b) {
7052 vec_orc(vector
unsigned short __a, vector
unsigned short __b) {
7057 vec_orc(vector
unsigned short __a, vector
bool short __b) {
7062 vec_orc(vector
bool short __a, vector
unsigned short __b) {
7067 vec_orc(vector
bool short __a, vector
bool short __b) {
7072 vec_orc(vector
signed int __a, vector
signed int __b) {
7076 static __inline__ vector
signed int __ATTRS_o_ai vec_orc(vector
signed int __a,
7077 vector
bool int __b) {
7082 vec_orc(vector
bool int __a, vector
signed int __b) {
7087 vec_orc(vector
unsigned int __a, vector
unsigned int __b) {
7092 vec_orc(vector
unsigned int __a, vector
bool int __b) {
7097 vec_orc(vector
bool int __a, vector
unsigned int __b) {
7101 static __inline__ vector
bool int __ATTRS_o_ai vec_orc(vector
bool int __a,
7102 vector
bool int __b) {
7107 vec_orc(vector
bool int __a, vector
float __b) {
7108 return (vector
float)(
__a | ~(vector
unsigned int)
__b);
7112 vec_orc(vector
float __a, vector
bool int __b) {
7113 return (vector
float)((vector
unsigned int)
__a | ~
__b);
7118 return (vector
float)((vector
unsigned int)
__a | ~(vector
unsigned int)
__b);
7122 vec_orc(vector
signed long long __a, vector
signed long long __b) {
7127 vec_orc(vector
signed long long __a, vector
bool long long __b) {
7132 vec_orc(vector
bool long long __a, vector
signed long long __b) {
7136 static __inline__ vector
unsigned long long __ATTRS_o_ai
7137 vec_orc(vector
unsigned long long __a, vector
unsigned long long __b) {
7141 static __inline__ vector
unsigned long long __ATTRS_o_ai
7142 vec_orc(vector
unsigned long long __a, vector
bool long long __b) {
7146 static __inline__ vector
unsigned long long __ATTRS_o_ai
7147 vec_orc(vector
bool long long __a, vector
unsigned long long __b) {
7152 vec_orc(vector
bool long long __a, vector
bool long long __b) {
7157 vec_orc(vector
double __a, vector
bool long long __b) {
7158 return (vector
double)((vector
unsigned long long)
__a | ~
__b);
7162 vec_orc(vector
bool long long __a, vector
double __b) {
7163 return (vector
double)(
__a | ~(vector
unsigned long long)
__b);
7166 static __inline__ vector
double __ATTRS_o_ai vec_orc(vector
double __a,
7167 vector
double __b) {
7168 return (vector
double)((vector
bool long long)
__a |
7169 ~(vector
unsigned long long)
__b);
7182 return (vector
signed char)
__a |
__b;
7187 return __a | (vector
signed char)
__b;
7197 return (vector
unsigned char)
__a |
__b;
7202 return __a | (vector
unsigned char)
__b;
7206 vector
bool char __b) {
7217 return (vector
short)
__a |
__b;
7221 vector
bool short __b) {
7222 return __a | (vector short)
__b;
7232 return (vector
unsigned short)
__a |
__b;
7237 return __a | (vector
unsigned short)
__b;
7252 return (vector
int)
__a |
__b;
7256 vector
bool int __b) {
7267 return (vector
unsigned int)
__a |
__b;
7276 vector
bool int __b) {
7282 vector
unsigned int __res =
7283 (vector
unsigned int)
__a | (vector
unsigned int)
__b;
7284 return (vector
float)__res;
7289 vector
unsigned int __res =
7290 (vector
unsigned int)
__a | (vector
unsigned int)
__b;
7291 return (vector
float)__res;
7295 vector
bool int __b) {
7296 vector
unsigned int __res =
7297 (vector
unsigned int)
__a | (vector
unsigned int)
__b;
7298 return (vector
float)__res;
7303 vec_vor(vector
signed long long __a, vector
signed long long __b) {
7308 vec_vor(vector
bool long long __a, vector
signed long long __b) {
7309 return (vector
signed long long)
__a |
__b;
7313 vec_vor(vector
signed long long __a, vector
bool long long __b) {
7314 return __a | (vector
signed long long)
__b;
7317 static __inline__ vector
unsigned long long __ATTRS_o_ai
7318 vec_vor(vector
unsigned long long __a, vector
unsigned long long __b) {
7322 static __inline__ vector
unsigned long long __ATTRS_o_ai
7323 vec_vor(vector
bool long long __a, vector
unsigned long long __b) {
7324 return (vector
unsigned long long)
__a |
__b;
7327 static __inline__ vector
unsigned long long __ATTRS_o_ai
7328 vec_vor(vector
unsigned long long __a, vector
bool long long __b) {
7329 return __a | (vector
unsigned long long)
__b;
7333 vec_vor(vector
bool long long __a, vector
bool long long __b) {
7345 #ifdef __LITTLE_ENDIAN__
7346 return (vector
signed char)
vec_perm(
7348 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7349 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7351 return (vector
signed char)
vec_perm(
7353 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7354 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7360 #ifdef __LITTLE_ENDIAN__
7361 return (vector
unsigned char)
vec_perm(
7363 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7364 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7366 return (vector
unsigned char)
vec_perm(
7368 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7369 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7375 #ifdef __LITTLE_ENDIAN__
7378 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7379 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7383 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7384 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7390 #ifdef __LITTLE_ENDIAN__
7393 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7394 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7398 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7399 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7405 #ifdef __LITTLE_ENDIAN__
7406 return (vector
unsigned short)
vec_perm(
7408 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7409 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7411 return (vector
unsigned short)
vec_perm(
7413 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7414 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7419 vector
bool int __b) {
7420 #ifdef __LITTLE_ENDIAN__
7421 return (vector
bool short)
vec_perm(
7423 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7424 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7426 return (vector
bool short)
vec_perm(
7428 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7429 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7435 vec_pack(vector
signed long long __a, vector
signed long long __b) {
7436 #ifdef __LITTLE_ENDIAN__
7437 return (vector
signed int)
vec_perm(
7439 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7440 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7442 return (vector
signed int)
vec_perm(
7444 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7445 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7449 vec_pack(vector
unsigned long long __a, vector
unsigned long long __b) {
7450 #ifdef __LITTLE_ENDIAN__
7451 return (vector
unsigned int)
vec_perm(
7453 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7454 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7456 return (vector
unsigned int)
vec_perm(
7458 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7459 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7465 #ifdef __LITTLE_ENDIAN__
7468 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7469 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7473 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7474 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7480 return (vector
float) (
__a[0],
__a[1],
__b[0],
__b[1]);
7484 #ifdef __POWER9_VECTOR__
7486 vec_pack_to_short_fp32(vector
float __a, vector
float __b) {
7487 vector
float __resa = __builtin_vsx_xvcvsphp(
__a);
7488 vector
float __resb = __builtin_vsx_xvcvsphp(
__b);
7489 #ifdef __LITTLE_ENDIAN__
7490 return (vector
unsigned short)vec_mergee(__resa, __resb);
7492 return (vector
unsigned short)vec_mergeo(__resa, __resb);
7499 #define __builtin_altivec_vpkuhum vec_vpkuhum
7503 #ifdef __LITTLE_ENDIAN__
7504 return (vector
signed char)
vec_perm(
7506 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7507 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7509 return (vector
signed char)
vec_perm(
7511 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7512 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7518 #ifdef __LITTLE_ENDIAN__
7519 return (vector
unsigned char)
vec_perm(
7521 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7522 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7524 return (vector
unsigned char)
vec_perm(
7526 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7527 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7533 #ifdef __LITTLE_ENDIAN__
7536 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7537 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7541 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7542 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7548 #define __builtin_altivec_vpkuwum vec_vpkuwum
7552 #ifdef __LITTLE_ENDIAN__
7555 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7556 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7560 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7561 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7567 #ifdef __LITTLE_ENDIAN__
7568 return (vector
unsigned short)
vec_perm(
7570 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7571 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7573 return (vector
unsigned short)
vec_perm(
7575 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7576 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7582 #ifdef __LITTLE_ENDIAN__
7583 return (vector
bool short)
vec_perm(
7585 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7586 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7588 return (vector
bool short)
vec_perm(
7590 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7591 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7597 #ifdef __POWER8_VECTOR__
7598 #define __builtin_altivec_vpkudum vec_vpkudum
7600 static __inline__ vector
int __ATTRS_o_ai vec_vpkudum(vector
long long __a,
7601 vector
long long __b) {
7602 #ifdef __LITTLE_ENDIAN__
7605 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7606 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7610 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7611 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7616 vec_vpkudum(vector
unsigned long long __a, vector
unsigned long long __b) {
7617 #ifdef __LITTLE_ENDIAN__
7618 return (vector
unsigned int)
vec_perm(
7620 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7621 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7623 return (vector
unsigned int)
vec_perm(
7625 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7626 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7631 vec_vpkudum(vector
bool long long __a, vector
bool long long __b) {
7632 #ifdef __LITTLE_ENDIAN__
7634 (vector
long long)
__a, (vector
long long)
__b,
7635 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7636 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7639 (vector
long long)
__a, (vector
long long)
__b,
7640 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7641 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7648 static __inline__ vector pixel
__attribute__((__always_inline__))
7649 vec_packpx(vector
unsigned int __a, vector
unsigned int __b) {
7650 #ifdef __LITTLE_ENDIAN__
7651 return (vector pixel)__builtin_altivec_vpkpx(
__b,
__a);
7653 return (vector pixel)__builtin_altivec_vpkpx(
__a,
__b);
7659 static __inline__ vector pixel
__attribute__((__always_inline__))
7660 vec_vpkpx(vector
unsigned int __a, vector
unsigned int __b) {
7661 #ifdef __LITTLE_ENDIAN__
7662 return (vector pixel)__builtin_altivec_vpkpx(
__b,
__a);
7664 return (vector pixel)__builtin_altivec_vpkpx(
__a,
__b);
7672 #ifdef __LITTLE_ENDIAN__
7673 return __builtin_altivec_vpkshss(
__b,
__a);
7675 return __builtin_altivec_vpkshss(
__a,
__b);
7681 #ifdef __LITTLE_ENDIAN__
7682 return __builtin_altivec_vpkuhus(
__b,
__a);
7684 return __builtin_altivec_vpkuhus(
__a,
__b);
7690 #ifdef __LITTLE_ENDIAN__
7691 return __builtin_altivec_vpkswss(
__b,
__a);
7693 return __builtin_altivec_vpkswss(
__a,
__b);
7699 #ifdef __LITTLE_ENDIAN__
7700 return __builtin_altivec_vpkuwus(
__b,
__a);
7702 return __builtin_altivec_vpkuwus(
__a,
__b);
7706 #ifdef __POWER8_VECTOR__
7708 vector
long long __b) {
7709 #ifdef __LITTLE_ENDIAN__
7710 return __builtin_altivec_vpksdss(
__b,
__a);
7712 return __builtin_altivec_vpksdss(
__a,
__b);
7717 vec_packs(vector
unsigned long long __a, vector
unsigned long long __b) {
7718 #ifdef __LITTLE_ENDIAN__
7719 return __builtin_altivec_vpkudus(
__b,
__a);
7721 return __builtin_altivec_vpkudus(
__a,
__b);
7728 static __inline__ vector
signed char __attribute__((__always_inline__))
7729 vec_vpkshss(vector
short __a, vector
short __b) {
7730 #ifdef __LITTLE_ENDIAN__
7731 return __builtin_altivec_vpkshss(
__b,
__a);
7733 return __builtin_altivec_vpkshss(
__a,
__b);
7739 #ifdef __POWER8_VECTOR__
7740 static __inline__ vector
int __ATTRS_o_ai vec_vpksdss(vector
long long __a,
7741 vector
long long __b) {
7742 #ifdef __LITTLE_ENDIAN__
7743 return __builtin_altivec_vpksdss(
__b,
__a);
7745 return __builtin_altivec_vpksdss(
__a,
__b);
7752 static __inline__ vector
unsigned char __attribute__((__always_inline__))
7753 vec_vpkuhus(vector
unsigned short __a, vector
unsigned short __b) {
7754 #ifdef __LITTLE_ENDIAN__
7755 return __builtin_altivec_vpkuhus(
__b,
__a);
7757 return __builtin_altivec_vpkuhus(
__a,
__b);
7763 #ifdef __POWER8_VECTOR__
7764 static __inline__ vector
unsigned int __attribute__((__always_inline__))
7765 vec_vpkudus(vector
unsigned long long __a, vector
unsigned long long __b) {
7766 #ifdef __LITTLE_ENDIAN__
7767 return __builtin_altivec_vpkudus(
__b,
__a);
7769 return __builtin_altivec_vpkudus(
__a,
__b);
7776 static __inline__ vector
signed short __attribute__((__always_inline__))
7777 vec_vpkswss(vector
int __a, vector
int __b) {
7778 #ifdef __LITTLE_ENDIAN__
7779 return __builtin_altivec_vpkswss(
__b,
__a);
7781 return __builtin_altivec_vpkswss(
__a,
__b);
7787 static __inline__ vector
unsigned short __attribute__((__always_inline__))
7788 vec_vpkuwus(vector
unsigned int __a, vector
unsigned int __b) {
7789 #ifdef __LITTLE_ENDIAN__
7790 return __builtin_altivec_vpkuwus(
__b,
__a);
7792 return __builtin_altivec_vpkuwus(
__a,
__b);
7800 #ifdef __LITTLE_ENDIAN__
7801 return __builtin_altivec_vpkshus(
__b,
__a);
7803 return __builtin_altivec_vpkshus(
__a,
__b);
7809 #ifdef __LITTLE_ENDIAN__
7810 return __builtin_altivec_vpkuhus(
__b,
__a);
7812 return __builtin_altivec_vpkuhus(
__a,
__b);
7818 #ifdef __LITTLE_ENDIAN__
7819 return __builtin_altivec_vpkswus(
__b,
__a);
7821 return __builtin_altivec_vpkswus(
__a,
__b);
7827 #ifdef __LITTLE_ENDIAN__
7828 return __builtin_altivec_vpkuwus(
__b,
__a);
7830 return __builtin_altivec_vpkuwus(
__a,
__b);
7834 #ifdef __POWER8_VECTOR__
7837 #ifdef __LITTLE_ENDIAN__
7838 return __builtin_altivec_vpksdus(
__b,
__a);
7840 return __builtin_altivec_vpksdus(
__a,
__b);
7846 #ifdef __LITTLE_ENDIAN__
7847 return __builtin_altivec_vpkudus(
__b,
__a);
7849 return __builtin_altivec_vpkudus(
__a,
__b);
7858 #ifdef __LITTLE_ENDIAN__
7859 return __builtin_altivec_vpkshus(
__b,
__a);
7861 return __builtin_altivec_vpkshus(
__a,
__b);
7867 #ifdef __LITTLE_ENDIAN__
7868 return __builtin_altivec_vpkuhus(
__b,
__a);
7870 return __builtin_altivec_vpkuhus(
__a,
__b);
7878 #ifdef __LITTLE_ENDIAN__
7879 return __builtin_altivec_vpkswus(
__b,
__a);
7881 return __builtin_altivec_vpkswus(
__a,
__b);
7887 #ifdef __LITTLE_ENDIAN__
7888 return __builtin_altivec_vpkuwus(
__b,
__a);
7890 return __builtin_altivec_vpkuwus(
__a,
__b);
7896 #ifdef __POWER8_VECTOR__
7898 vec_vpksdus(vector
long long __a, vector
long long __b) {
7899 #ifdef __LITTLE_ENDIAN__
7900 return __builtin_altivec_vpksdus(
__b,
__a);
7902 return __builtin_altivec_vpksdus(
__a,
__b);
7918 vector
signed char __a, vector
signed char __b, vector
unsigned char __c) {
7919 #ifdef __LITTLE_ENDIAN__
7920 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7921 255, 255, 255, 255, 255, 255, 255, 255};
7923 return (vector
signed char)__builtin_altivec_vperm_4si((vector
int)
__b,
7924 (vector
int)
__a, __d);
7926 return (vector
signed char)__builtin_altivec_vperm_4si((vector
int)
__a,
7933 vector
unsigned char __c) {
7934 #ifdef __LITTLE_ENDIAN__
7935 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7936 255, 255, 255, 255, 255, 255, 255, 255};
7938 return (vector
unsigned char)__builtin_altivec_vperm_4si(
7939 (vector
int)
__b, (vector
int)
__a, __d);
7941 return (vector
unsigned char)__builtin_altivec_vperm_4si(
7948 #ifdef __LITTLE_ENDIAN__
7949 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7950 255, 255, 255, 255, 255, 255, 255, 255};
7952 return (vector
bool char)__builtin_altivec_vperm_4si((vector
int)
__b,
7953 (vector
int)
__a, __d);
7955 return (vector
bool char)__builtin_altivec_vperm_4si((vector
int)
__a,
7961 vector
signed short __b,
7962 vector
unsigned char __c) {
7963 #ifdef __LITTLE_ENDIAN__
7964 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7965 255, 255, 255, 255, 255, 255, 255, 255};
7967 return (vector
signed short)__builtin_altivec_vperm_4si((vector
int)
__b,
7968 (vector
int)
__a, __d);
7970 return (vector
signed short)__builtin_altivec_vperm_4si((vector
int)
__a,
7977 vector
unsigned char __c) {
7978 #ifdef __LITTLE_ENDIAN__
7979 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7980 255, 255, 255, 255, 255, 255, 255, 255};
7982 return (vector
unsigned short)__builtin_altivec_vperm_4si(
7983 (vector
int)
__b, (vector
int)
__a, __d);
7985 return (vector
unsigned short)__builtin_altivec_vperm_4si(
7991 vector
bool short __a, vector
bool short __b, vector
unsigned char __c) {
7992 #ifdef __LITTLE_ENDIAN__
7993 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7994 255, 255, 255, 255, 255, 255, 255, 255};
7996 return (vector
bool short)__builtin_altivec_vperm_4si((vector
int)
__b,
7997 (vector
int)
__a, __d);
7999 return (vector
bool short)__builtin_altivec_vperm_4si((vector
int)
__a,
8006 vector
unsigned char __c) {
8007 #ifdef __LITTLE_ENDIAN__
8008 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8009 255, 255, 255, 255, 255, 255, 255, 255};
8011 return (vector pixel)__builtin_altivec_vperm_4si((vector
int)
__b,
8012 (vector
int)
__a, __d);
8014 return (vector pixel)__builtin_altivec_vperm_4si((vector
int)
__a,
8020 vector
signed int __b,
8021 vector
unsigned char __c) {
8022 #ifdef __LITTLE_ENDIAN__
8023 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8024 255, 255, 255, 255, 255, 255, 255, 255};
8026 return (vector
signed int)__builtin_altivec_vperm_4si(
__b,
__a, __d);
8028 return (vector
signed int)__builtin_altivec_vperm_4si(
__a,
__b,
__c);
8034 vector
unsigned char __c) {
8035 #ifdef __LITTLE_ENDIAN__
8036 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8037 255, 255, 255, 255, 255, 255, 255, 255};
8039 return (vector
unsigned int)__builtin_altivec_vperm_4si((vector
int)
__b,
8040 (vector
int)
__a, __d);
8042 return (vector
unsigned int)__builtin_altivec_vperm_4si((vector
int)
__a,
8049 #ifdef __LITTLE_ENDIAN__
8050 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8051 255, 255, 255, 255, 255, 255, 255, 255};
8053 return (vector
bool int)__builtin_altivec_vperm_4si((vector
int)
__b,
8054 (vector
int)
__a, __d);
8056 return (vector
bool int)__builtin_altivec_vperm_4si((vector
int)
__a,
8063 vector
unsigned char __c) {
8064 #ifdef __LITTLE_ENDIAN__
8065 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8066 255, 255, 255, 255, 255, 255, 255, 255};
8068 return (vector
float)__builtin_altivec_vperm_4si((vector
int)
__b,
8069 (vector
int)
__a, __d);
8071 return (vector
float)__builtin_altivec_vperm_4si((vector
int)
__a,
8078 vec_perm(vector
signed long long __a, vector
signed long long __b,
8079 vector
unsigned char __c) {
8080 #ifdef __LITTLE_ENDIAN__
8081 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8082 255, 255, 255, 255, 255, 255, 255, 255};
8084 return (vector
signed long long)__builtin_altivec_vperm_4si(
8085 (vector
int)
__b, (vector
int)
__a, __d);
8087 return (vector
signed long long)__builtin_altivec_vperm_4si(
8092 static __inline__ vector
unsigned long long __ATTRS_o_ai
8093 vec_perm(vector
unsigned long long __a, vector
unsigned long long __b,
8094 vector
unsigned char __c) {
8095 #ifdef __LITTLE_ENDIAN__
8096 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8097 255, 255, 255, 255, 255, 255, 255, 255};
8099 return (vector
unsigned long long)__builtin_altivec_vperm_4si(
8100 (vector
int)
__b, (vector
int)
__a, __d);
8102 return (vector
unsigned long long)__builtin_altivec_vperm_4si(
8109 vector
unsigned char __c) {
8110 #ifdef __LITTLE_ENDIAN__
8111 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8112 255, 255, 255, 255, 255, 255, 255, 255};
8114 return (vector
bool long long)__builtin_altivec_vperm_4si(
8115 (vector
int)
__b, (vector
int)
__a, __d);
8117 return (vector
bool long long)__builtin_altivec_vperm_4si(
8124 #ifdef __LITTLE_ENDIAN__
8125 vector
unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8126 255, 255, 255, 255, 255, 255, 255, 255};
8128 return (vector
double)__builtin_altivec_vperm_4si((vector
int)
__b,
8129 (vector
int)
__a, __d);
8131 return (vector
double)__builtin_altivec_vperm_4si((vector
int)
__a,
8140 vector
signed char __a, vector
signed char __b, vector
unsigned char __c) {
8146 vector
unsigned char __c) {
8151 vector
bool char __a, vector
bool char __b, vector
unsigned char __c) {
8162 vector
unsigned char __c) {
8167 vector
bool short __a, vector
bool short __b, vector
unsigned char __c) {
8178 vector
unsigned char __c) {
8184 vector
unsigned char __c) {
8200 vector
long long __a, vector
long long __b, vector
unsigned char __c) {
8204 static __inline__ vector
unsigned long long __ATTRS_o_ai
8205 vec_vperm(vector
unsigned long long __a, vector
unsigned long long __b,
8206 vector
unsigned char __c) {
8220 return __builtin_vsx_xvresp(
__a);
8222 return __builtin_altivec_vrefp(
__a);
8228 return __builtin_vsx_xvredp(
__a);
8234 static __inline__ vector
float __attribute__((__always_inline__))
8235 vec_vrefp(vector
float __a) {
8236 return __builtin_altivec_vrefp(
__a);
8243 return (vector
signed char)__builtin_altivec_vrlb((vector
char)
__a,
__b);
8248 return (vector
unsigned char)__builtin_altivec_vrlb((vector
char)
__a,
__b);
8252 vector
unsigned short __b) {
8253 return __builtin_altivec_vrlh(
__a,
__b);
8258 return (vector
unsigned short)__builtin_altivec_vrlh((vector
short)
__a,
__b);
8262 vector
unsigned int __b) {
8263 return __builtin_altivec_vrlw(
__a,
__b);
8268 return (vector
unsigned int)__builtin_altivec_vrlw((vector
int)
__a,
__b);
8271 #ifdef __POWER8_VECTOR__
8273 vec_rl(vector
signed long long __a, vector
unsigned long long __b) {
8274 return __builtin_altivec_vrld(
__a,
__b);
8277 static __inline__ vector
unsigned long long __ATTRS_o_ai
8278 vec_rl(vector
unsigned long long __a, vector
unsigned long long __b) {
8279 return __builtin_altivec_vrld(
__a,
__b);
8283 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8285 vec_rl(vector
signed __int128
__a, vector
unsigned __int128
__b) {
8286 return (
__b <<
__a)|(
__b >> ((__CHAR_BIT__ *
sizeof(vector
signed __int128)) -
__a));
8289 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
8290 vec_rl(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
8291 return (
__b <<
__a)|(
__b >> ((__CHAR_BIT__ *
sizeof(vector
unsigned __int128)) -
__a));
8296 #ifdef __POWER9_VECTOR__
8298 vec_rlmi(vector
unsigned int __a, vector
unsigned int __b,
8299 vector
unsigned int __c) {
8300 return __builtin_altivec_vrlwmi(
__a,
__c,
__b);
8303 static __inline__ vector
unsigned long long __ATTRS_o_ai
8304 vec_rlmi(vector
unsigned long long __a, vector
unsigned long long __b,
8305 vector
unsigned long long __c) {
8306 return __builtin_altivec_vrldmi(
__a,
__c,
__b);
8310 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8311 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
8312 vec_rlmi(vector
unsigned __int128
__a, vector
unsigned __int128
__b,
8313 vector
unsigned __int128
__c) {
8314 return __builtin_altivec_vrlqmi(
__a,
__c,
__b);
8318 vec_rlmi(vector
signed __int128
__a, vector
signed __int128
__b,
8319 vector
signed __int128
__c) {
8320 return __builtin_altivec_vrlqmi(
__a,
__c,
__b);
8325 #ifdef __POWER9_VECTOR__
8327 vec_rlnm(vector
unsigned int __a, vector
unsigned int __b,
8328 vector
unsigned int __c) {
8329 vector
unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };
8330 return __builtin_altivec_vrlwnm(
__a, ((
__c << OneByte) |
__b));
8333 static __inline__ vector
unsigned long long __ATTRS_o_ai
8334 vec_rlnm(vector
unsigned long long __a, vector
unsigned long long __b,
8335 vector
unsigned long long __c) {
8336 vector
unsigned long long OneByte = { 0x8, 0x8 };
8337 return __builtin_altivec_vrldnm(
__a, ((
__c << OneByte) |
__b));
8341 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8342 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
8343 vec_rlnm(vector
unsigned __int128
__a, vector
unsigned __int128
__b,
8344 vector
unsigned __int128
__c) {
8346 vector
unsigned char TmpB = (vector
unsigned char)
__b;
8347 vector
unsigned char TmpC = (vector
unsigned char)
__c;
8348 vector
unsigned char MaskAndShift =
8349 #ifdef __LITTLE_ENDIAN__
8350 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,
8351 1, -1, -1, -1, -1, -1);
8353 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, 31, 30, 15, -1,
8354 -1, -1, -1, -1, -1, -1, -1);
8356 return __builtin_altivec_vrlqnm(
__a, (vector
unsigned __int128) MaskAndShift);
8360 vec_rlnm(vector
signed __int128
__a, vector
signed __int128
__b,
8361 vector
signed __int128
__c) {
8363 vector
unsigned char TmpB = (vector
unsigned char)
__b;
8364 vector
unsigned char TmpC = (vector
unsigned char)
__c;
8365 vector
unsigned char MaskAndShift =
8366 #ifdef __LITTLE_ENDIAN__
8367 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,
8368 1, -1, -1, -1, -1, -1);
8370 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, 31, 30, 15, -1,
8371 -1, -1, -1, -1, -1, -1, -1);
8373 return __builtin_altivec_vrlqnm(
__a, (vector
unsigned __int128) MaskAndShift);
8381 return (vector
signed char)__builtin_altivec_vrlb((vector
char)
__a,
__b);
8386 return (vector
unsigned char)__builtin_altivec_vrlb((vector
char)
__a,
__b);
8393 return __builtin_altivec_vrlh(
__a,
__b);
8398 return (vector
unsigned short)__builtin_altivec_vrlh((vector
short)
__a,
__b);
8404 vector
unsigned int __b) {
8405 return __builtin_altivec_vrlw(
__a,
__b);
8410 return (vector
unsigned int)__builtin_altivec_vrlw((vector
int)
__a,
__b);
8416 return __builtin_altivec_vrfin(
__a);
8420 #ifdef __XL_COMPAT_ALTIVEC__
8421 static __inline__ vector
double __ATTRS_o_ai vec_rint(vector
double __a);
8423 double __fpscr = __builtin_readflm();
8424 __builtin_setrnd(0);
8425 vector
double __rounded = vec_rint(
__a);
8426 __builtin_setflm(__fpscr);
8431 return __builtin_vsx_xvrdpi(
__a);
8437 static __inline__ vector
float __ATTRS_o_ai vec_rint(vector
float __a) {
8438 return __builtin_vsx_xvrspic(
__a);
8441 static __inline__ vector
double __ATTRS_o_ai vec_rint(vector
double __a) {
8442 return __builtin_vsx_xvrdpic(
__a);
8447 static __inline__ vector
float __ATTRS_o_ai vec_roundc(vector
float __a) {
8448 return __builtin_vsx_xvrspic(
__a);
8451 static __inline__ vector
double __ATTRS_o_ai vec_roundc(vector
double __a) {
8452 return __builtin_vsx_xvrdpic(
__a);
8457 static __inline__ vector
float __ATTRS_o_ai vec_nearbyint(vector
float __a) {
8458 return __builtin_vsx_xvrspi(
__a);
8461 static __inline__ vector
double __ATTRS_o_ai vec_nearbyint(vector
double __a) {
8462 return __builtin_vsx_xvrdpi(
__a);
8468 static __inline__ vector
float __attribute__((__always_inline__))
8469 vec_vrfin(vector
float __a) {
8470 return __builtin_altivec_vrfin(
__a);
8476 static __inline__ vector
float __ATTRS_o_ai vec_sqrt(vector
float __a) {
8477 return __builtin_vsx_xvsqrtsp(
__a);
8480 static __inline__ vector
double __ATTRS_o_ai vec_sqrt(vector
double __a) {
8481 return __builtin_vsx_xvsqrtdp(
__a);
8489 return __builtin_vsx_xvrsqrtesp(
__a);
8491 return __builtin_altivec_vrsqrtefp(
__a);
8497 return __builtin_vsx_xvrsqrtedp(
__a);
8502 return __builtin_ppc_rsqrtf(
__a);
8507 return __builtin_ppc_rsqrtd(
__a);
8513 static __inline__ __vector
float __attribute__((__always_inline__))
8514 vec_vrsqrtefp(vector
float __a) {
8515 return __builtin_altivec_vrsqrtefp(
__a);
8521 static __inline__
int __ATTRS_o_ai vec_test_swsqrt(vector
double __a) {
8522 return __builtin_vsx_xvtsqrtdp(
__a);
8525 static __inline__
int __ATTRS_o_ai vec_test_swsqrts(vector
float __a) {
8526 return __builtin_vsx_xvtsqrtsp(
__a);
8532 #define __builtin_altivec_vsel_4si vec_sel
8535 vector
signed char __a, vector
signed char __b, vector
unsigned char __c) {
8536 return (
__a & ~(vector
signed char)
__c) | (
__b & (vector
signed char)
__c);
8541 return (
__a & ~(vector
signed char)
__c) | (
__b & (vector
signed char)
__c);
8546 vector
unsigned char __c) {
8551 vector
unsigned char __a, vector
unsigned char __b, vector
bool char __c) {
8552 return (
__a & ~(vector
unsigned char)
__c) | (
__b & (vector
unsigned char)
__c);
8557 return (
__a & ~(vector
bool char)
__c) | (
__b & (vector
bool char)
__c);
8561 vector
bool char __b,
8562 vector
bool char __c) {
8568 vector
unsigned short __c) {
8569 return (
__a & ~(vector
short)
__c) | (
__b & (vector short)
__c);
8574 vector
bool short __c) {
8575 return (
__a & ~(vector
short)
__c) | (
__b & (vector short)
__c);
8580 vector
unsigned short __c) {
8586 vector
bool short __c) {
8587 return (
__a & ~(vector
unsigned short)
__c) |
8588 (
__b & (vector
unsigned short)
__c);
8592 vector
bool short __a, vector
bool short __b, vector
unsigned short __c) {
8593 return (
__a & ~(vector
bool short)
__c) | (
__b & (vector
bool short)
__c);
8603 vector
unsigned int __c) {
8609 vector
bool int __c) {
8614 vector
unsigned int __a, vector
unsigned int __b, vector
unsigned int __c) {
8620 return (
__a & ~(vector
unsigned int)
__c) | (
__b & (vector
unsigned int)
__c);
8629 vector
bool int __b,
8630 vector
bool int __c) {
8636 vector
unsigned int __c) {
8637 vector
int __res = ((vector
int)
__a & ~(vector
int)
__c) |
8639 return (vector
float)__res;
8644 vector
bool int __c) {
8645 vector
int __res = ((vector
int)
__a & ~(vector
int)
__c) |
8647 return (vector
float)__res;
8653 vector
long long __res = ((vector
long long)
__a & ~(vector
long long)
__c) |
8654 ((vector
long long)
__b & (vector
long long)
__c);
8655 return (vector
double)__res;
8659 vec_sel(vector
double __a, vector
double __b, vector
unsigned long long __c) {
8660 vector
long long __res = ((vector
long long)
__a & ~(vector
long long)
__c) |
8661 ((vector
long long)
__b & (vector
long long)
__c);
8662 return (vector
double)__res;
8666 vec_sel(vector
bool long long __a, vector
bool long long __b,
8667 vector
bool long long __c) {
8672 vec_sel(vector
bool long long __a, vector
bool long long __b,
8673 vector
unsigned long long __c) {
8674 return (
__a & ~(vector
bool long long)
__c) |
8675 (
__b & (vector
bool long long)
__c);
8679 vec_sel(vector
signed long long __a, vector
signed long long __b,
8680 vector
bool long long __c) {
8681 return (
__a & ~(vector
signed long long)
__c) |
8682 (
__b & (vector
signed long long)
__c);
8686 vec_sel(vector
signed long long __a, vector
signed long long __b,
8687 vector
unsigned long long __c) {
8688 return (
__a & ~(vector
signed long long)
__c) |
8689 (
__b & (vector
signed long long)
__c);
8692 static __inline__ vector
unsigned long long __ATTRS_o_ai
8693 vec_sel(vector
unsigned long long __a, vector
unsigned long long __b,
8694 vector
bool long long __c) {
8695 return (
__a & ~(vector
unsigned long long)
__c) |
8696 (
__b & (vector
unsigned long long)
__c);
8699 static __inline__ vector
unsigned long long __ATTRS_o_ai
8700 vec_sel(vector
unsigned long long __a, vector
unsigned long long __b,
8701 vector
unsigned long long __c) {
8709 vector
signed char __a, vector
signed char __b, vector
unsigned char __c) {
8710 return (
__a & ~(vector
signed char)
__c) | (
__b & (vector
signed char)
__c);
8715 return (
__a & ~(vector
signed char)
__c) | (
__b & (vector
signed char)
__c);
8720 vector
unsigned char __c) {
8725 vector
unsigned char __a, vector
unsigned char __b, vector
bool char __c) {
8726 return (
__a & ~(vector
unsigned char)
__c) | (
__b & (vector
unsigned char)
__c);
8731 return (
__a & ~(vector
bool char)
__c) | (
__b & (vector
bool char)
__c);
8735 vector
bool char __b,
8736 vector
bool char __c) {
8742 return (
__a & ~(vector
short)
__c) | (
__b & (vector short)
__c);
8747 vector
bool short __c) {
8748 return (
__a & ~(vector
short)
__c) | (
__b & (vector short)
__c);
8753 vector
unsigned short __c) {
8759 vector
bool short __c) {
8760 return (
__a & ~(vector
unsigned short)
__c) |
8761 (
__b & (vector
unsigned short)
__c);
8765 vector
bool short __a, vector
bool short __b, vector
unsigned short __c) {
8766 return (
__a & ~(vector
bool short)
__c) | (
__b & (vector
bool short)
__c);
8776 vector
unsigned int __c) {
8782 vector
bool int __c) {
8787 vector
unsigned int __a, vector
unsigned int __b, vector
unsigned int __c) {
8792 vector
unsigned int __a, vector
unsigned int __b, vector
bool int __c) {
8793 return (
__a & ~(vector
unsigned int)
__c) | (
__b & (vector
unsigned int)
__c);
8802 vector
bool int __b,
8803 vector
bool int __c) {
8809 vector
unsigned int __c) {
8810 vector
int __res = ((vector
int)
__a & ~(vector
int)
__c) |
8812 return (vector
float)__res;
8817 vector
bool int __c) {
8818 vector
int __res = ((vector
int)
__a & ~(vector
int)
__c) |
8820 return (vector
float)__res;
8830 (vector
unsigned char)(
sizeof(
unsigned char) * __CHAR_BIT__));
8835 return (vector
signed char)
vec_sl((vector
unsigned char)
__a,
__b);
8840 return __a << (
__b % (vector
unsigned short)(
sizeof(
unsigned short) *
8845 vector
unsigned short __b) {
8846 return (vector
short)
vec_sl((vector
unsigned short)
__a,
__b);
8852 (vector
unsigned int)(
sizeof(
unsigned int) * __CHAR_BIT__));
8856 vector
unsigned int __b) {
8857 return (vector
int)
vec_sl((vector
unsigned int)
__a,
__b);
8860 #ifdef __POWER8_VECTOR__
8861 static __inline__ vector
unsigned long long __ATTRS_o_ai
8862 vec_sl(vector
unsigned long long __a, vector
unsigned long long __b) {
8863 return __a << (
__b % (vector
unsigned long long)(
sizeof(
unsigned long long) *
8868 vec_sl(vector
long long __a, vector
unsigned long long __b) {
8869 return (vector
long long)
vec_sl((vector
unsigned long long)
__a,
__b);
8871 #elif defined(__VSX__)
8874 static __inline__ vector
unsigned long long __ATTRS_o_ai
8875 vec_sl(vector
unsigned long long __a, vector
unsigned long long __b) {
8876 __b %= (vector
unsigned long long)(
sizeof(
unsigned long long) * __CHAR_BIT__);
8881 vector
signed long long __rightelt =
8882 (vector
signed long long)__builtin_altivec_vslo((vector
signed int)
__a,
8884 #ifdef __LITTLE_ENDIAN__
8885 __rightelt = (vector
signed long long)__builtin_altivec_vsl(
8886 (vector
signed int)__rightelt,
8889 __rightelt = (vector
signed long long)__builtin_altivec_vsl(
8890 (vector
signed int)__rightelt,
8893 __a = __builtin_shufflevector(
__a,
__a, 1, 0);
8894 __b = __builtin_shufflevector(
__b,
__b, 1, 0);
8895 vector
signed long long __leftelt =
8896 (vector
signed long long)__builtin_altivec_vslo((vector
signed int)
__a,
8898 #ifdef __LITTLE_ENDIAN__
8899 __leftelt = (vector
signed long long)__builtin_altivec_vsl(
8900 (vector
signed int)__leftelt,
8902 return (vector
unsigned long long)__builtin_shufflevector(__rightelt,
8905 __leftelt = (vector
signed long long)__builtin_altivec_vsl(
8906 (vector
signed int)__leftelt,
8908 return (vector
unsigned long long)__builtin_shufflevector(__leftelt,
8914 vec_sl(vector
long long __a, vector
unsigned long long __b) {
8915 return (vector
long long)
vec_sl((vector
unsigned long long)
__a,
__b);
8921 #define __builtin_altivec_vslb vec_vslb
8935 #define __builtin_altivec_vslh vec_vslh
8949 #define __builtin_altivec_vslw vec_vslw
8952 vector
unsigned int __b) {
8963 #define __builtin_altivec_vsldoi_4si vec_sld
8966 vector
signed char __a, vector
signed char __b,
unsigned const int __c) {
8967 unsigned char __d =
__c & 0x0F;
8968 #ifdef __LITTLE_ENDIAN__
8970 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8971 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8972 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8973 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8977 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8978 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8979 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8985 unsigned const int __c) {
8986 unsigned char __d =
__c & 0x0F;
8987 #ifdef __LITTLE_ENDIAN__
8989 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8990 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8991 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8992 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8996 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8997 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8998 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9004 unsigned char __d =
__c & 0x0F;
9005 #ifdef __LITTLE_ENDIAN__
9007 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9008 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9009 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9010 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9014 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9015 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9016 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9021 vector
signed short __a, vector
signed short __b,
unsigned const int __c) {
9022 unsigned char __d =
__c & 0x0F;
9023 #ifdef __LITTLE_ENDIAN__
9025 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9026 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9027 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9028 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9032 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9033 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9034 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9040 unsigned const int __c) {
9041 unsigned char __d =
__c & 0x0F;
9042 #ifdef __LITTLE_ENDIAN__
9044 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9045 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9046 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9047 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9051 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9052 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9053 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9059 unsigned char __d =
__c & 0x0F;
9060 #ifdef __LITTLE_ENDIAN__
9062 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9063 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9064 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9065 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9069 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9070 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9071 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9077 unsigned const int __c) {
9078 unsigned char __d =
__c & 0x0F;
9079 #ifdef __LITTLE_ENDIAN__
9081 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9082 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9083 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9084 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9088 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9089 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9090 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9096 unsigned char __d =
__c & 0x0F;
9097 #ifdef __LITTLE_ENDIAN__
9099 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9100 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9101 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9102 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9106 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9107 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9108 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9113 vector
unsigned int __a, vector
unsigned int __b,
unsigned const int __c) {
9114 unsigned char __d =
__c & 0x0F;
9115 #ifdef __LITTLE_ENDIAN__
9117 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9118 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9119 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9120 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9124 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9125 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9126 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9131 vector
bool int __b,
9132 unsigned const int __c) {
9133 unsigned char __d =
__c & 0x0F;
9134 #ifdef __LITTLE_ENDIAN__
9136 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9137 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9138 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9139 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9143 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9144 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9145 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9151 unsigned const int __c) {
9152 unsigned char __d =
__c & 0x0F;
9153 #ifdef __LITTLE_ENDIAN__
9155 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9156 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9157 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9158 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9162 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9163 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9164 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9170 vec_sld(vector
bool long long __a, vector
bool long long __b,
9171 unsigned const int __c) {
9172 unsigned char __d =
__c & 0x0F;
9173 #ifdef __LITTLE_ENDIAN__
9175 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9176 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9177 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9178 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9182 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9183 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9184 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9189 vec_sld(vector
signed long long __a, vector
signed long long __b,
9190 unsigned const int __c) {
9191 unsigned char __d =
__c & 0x0F;
9192 #ifdef __LITTLE_ENDIAN__
9194 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9195 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9196 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9197 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9201 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9202 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9203 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9207 static __inline__ vector
unsigned long long __ATTRS_o_ai
9208 vec_sld(vector
unsigned long long __a, vector
unsigned long long __b,
9209 unsigned const int __c) {
9210 unsigned char __d =
__c & 0x0F;
9211 #ifdef __LITTLE_ENDIAN__
9213 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9214 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9215 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9216 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9220 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9221 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9222 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9228 unsigned const int __c) {
9229 unsigned char __d =
__c & 0x0F;
9230 #ifdef __LITTLE_ENDIAN__
9232 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9233 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9234 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9235 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9239 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9240 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9241 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9248 vector
signed char __a, vector
signed char __b,
unsigned const int __c) {
9254 unsigned const int __c) {
9259 vector
signed short __a, vector
signed short __b,
unsigned const int __c) {
9265 unsigned const int __c) {
9275 vector
unsigned int __a, vector
unsigned int __b,
unsigned const int __c) {
9280 vector
float __a, vector
float __b,
unsigned const int __c) {
9286 vec_sldw(vector
signed long long __a, vector
signed long long __b,
9287 unsigned const int __c) {
9291 static __inline__ vector
unsigned long long __ATTRS_o_ai
9292 vec_sldw(vector
unsigned long long __a, vector
unsigned long long __b,
9293 unsigned const int __c) {
9298 vector
double __a, vector
double __b,
unsigned const int __c) {
9303 #ifdef __POWER9_VECTOR__
9306 vec_slv(vector
unsigned char __a, vector
unsigned char __b) {
9307 return __builtin_altivec_vslv(
__a,
__b);
9312 vec_srv(vector
unsigned char __a, vector
unsigned char __b) {
9313 return __builtin_altivec_vsrv(
__a,
__b);
9321 unsigned char __d =
__c & 0x0F;
9322 #ifdef __LITTLE_ENDIAN__
9324 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9325 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9326 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9327 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9331 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9332 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9333 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9338 vector
unsigned char __a, vector
unsigned char __b,
unsigned char __c) {
9339 unsigned char __d =
__c & 0x0F;
9340 #ifdef __LITTLE_ENDIAN__
9342 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9343 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9344 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9345 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9349 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9350 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9351 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9357 unsigned char __c) {
9358 unsigned char __d =
__c & 0x0F;
9359 #ifdef __LITTLE_ENDIAN__
9361 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9362 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9363 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9364 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9368 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9369 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9370 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9375 vector
unsigned short __a, vector
unsigned short __b,
unsigned char __c) {
9376 unsigned char __d =
__c & 0x0F;
9377 #ifdef __LITTLE_ENDIAN__
9379 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9380 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9381 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9382 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9386 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9387 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9388 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9394 unsigned char __c) {
9395 unsigned char __d =
__c & 0x0F;
9396 #ifdef __LITTLE_ENDIAN__
9398 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9399 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9400 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9401 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9405 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9406 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9407 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9413 unsigned char __c) {
9414 unsigned char __d =
__c & 0x0F;
9415 #ifdef __LITTLE_ENDIAN__
9417 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9418 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9419 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9420 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9424 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9425 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9426 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9431 vector
unsigned int __a, vector
unsigned int __b,
unsigned char __c) {
9432 unsigned char __d =
__c & 0x0F;
9433 #ifdef __LITTLE_ENDIAN__
9435 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9436 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9437 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9438 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9442 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9443 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9444 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9450 unsigned char __c) {
9451 unsigned char __d =
__c & 0x0F;
9452 #ifdef __LITTLE_ENDIAN__
9454 __b,
__a, (vector
unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9455 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9456 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9457 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9461 (vector
unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9462 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9463 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9471 return (vector
signed char)__builtin_altivec_vsl((vector
int)
__a,
9477 return (vector
signed char)__builtin_altivec_vsl((vector
int)
__a,
9483 return (vector
signed char)__builtin_altivec_vsl((vector
int)
__a,
9489 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)
__a,
9495 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)
__a,
9501 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)
__a,
9507 return (vector
bool char)__builtin_altivec_vsl((vector
int)
__a,
9513 return (vector
bool char)__builtin_altivec_vsl((vector
int)
__a,
9519 return (vector
bool char)__builtin_altivec_vsl((vector
int)
__a,
9524 vector
unsigned char __b) {
9525 return (vector
short)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9529 vector
unsigned short __b) {
9530 return (vector
short)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9534 vector
unsigned int __b) {
9535 return (vector
short)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9540 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)
__a,
9546 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)
__a,
9552 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)
__a,
9558 return (vector
bool short)__builtin_altivec_vsl((vector
int)
__a,
9564 return (vector
bool short)__builtin_altivec_vsl((vector
int)
__a,
9570 return (vector
bool short)__builtin_altivec_vsl((vector
int)
__a,
9575 vector
unsigned char __b) {
9576 return (vector pixel)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9580 vector
unsigned short __b) {
9581 return (vector pixel)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9585 vector
unsigned int __b) {
9586 return (vector pixel)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9590 vector
unsigned char __b) {
9591 return (vector
int)__builtin_altivec_vsl(
__a, (vector
int)
__b);
9595 vector
unsigned short __b) {
9596 return (vector
int)__builtin_altivec_vsl(
__a, (vector
int)
__b);
9600 vector
unsigned int __b) {
9601 return (vector
int)__builtin_altivec_vsl(
__a, (vector
int)
__b);
9606 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)
__a,
9612 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)
__a,
9618 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)
__a,
9624 return (vector
bool int)__builtin_altivec_vsl((vector
int)
__a,
9630 return (vector
bool int)__builtin_altivec_vsl((vector
int)
__a,
9636 return (vector
bool int)__builtin_altivec_vsl((vector
int)
__a,
9642 vec_sll(vector
signed long long __a, vector
unsigned char __b) {
9643 return (vector
signed long long)__builtin_altivec_vsl((vector
int)
__a,
9647 static __inline__ vector
unsigned long long __ATTRS_o_ai
9648 vec_sll(vector
unsigned long long __a, vector
unsigned char __b) {
9649 return (vector
unsigned long long)__builtin_altivec_vsl((vector
int)
__a,
9658 return (vector
signed char)__builtin_altivec_vsl((vector
int)
__a,
9664 return (vector
signed char)__builtin_altivec_vsl((vector
int)
__a,
9670 return (vector
signed char)__builtin_altivec_vsl((vector
int)
__a,
9676 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)
__a,
9682 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)
__a,
9688 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)
__a,
9694 return (vector
bool char)__builtin_altivec_vsl((vector
int)
__a,
9700 return (vector
bool char)__builtin_altivec_vsl((vector
int)
__a,
9706 return (vector
bool char)__builtin_altivec_vsl((vector
int)
__a,
9711 vector
unsigned char __b) {
9712 return (vector
short)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9716 vector
unsigned short __b) {
9717 return (vector
short)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9721 vector
unsigned int __b) {
9722 return (vector
short)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9727 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)
__a,
9733 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)
__a,
9739 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)
__a,
9745 return (vector
bool short)__builtin_altivec_vsl((vector
int)
__a,
9751 return (vector
bool short)__builtin_altivec_vsl((vector
int)
__a,
9757 return (vector
bool short)__builtin_altivec_vsl((vector
int)
__a,
9762 vector
unsigned char __b) {
9763 return (vector pixel)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9767 vector
unsigned short __b) {
9768 return (vector pixel)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9772 vector
unsigned int __b) {
9773 return (vector pixel)__builtin_altivec_vsl((vector
int)
__a, (vector
int)
__b);
9777 vector
unsigned char __b) {
9778 return (vector
int)__builtin_altivec_vsl(
__a, (vector
int)
__b);
9782 vector
unsigned short __b) {
9783 return (vector
int)__builtin_altivec_vsl(
__a, (vector
int)
__b);
9787 vector
unsigned int __b) {
9788 return (vector
int)__builtin_altivec_vsl(
__a, (vector
int)
__b);
9793 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)
__a,
9799 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)
__a,
9805 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)
__a,
9811 return (vector
bool int)__builtin_altivec_vsl((vector
int)
__a,
9817 return (vector
bool int)__builtin_altivec_vsl((vector
int)
__a,
9823 return (vector
bool int)__builtin_altivec_vsl((vector
int)
__a,
9831 return (vector
signed char)__builtin_altivec_vslo((vector
int)
__a,
9837 return (vector
signed char)__builtin_altivec_vslo((vector
int)
__a,
9843 return (vector
unsigned char)__builtin_altivec_vslo((vector
int)
__a,
9849 return (vector
unsigned char)__builtin_altivec_vslo((vector
int)
__a,
9854 vector
signed char __b) {
9855 return (vector
short)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
9859 vector
unsigned char __b) {
9860 return (vector
short)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
9865 return (vector
unsigned short)__builtin_altivec_vslo((vector
int)
__a,
9871 return (vector
unsigned short)__builtin_altivec_vslo((vector
int)
__a,
9876 vector
signed char __b) {
9877 return (vector pixel)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
9881 vector
unsigned char __b) {
9882 return (vector pixel)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
9886 vector
signed char __b) {
9887 return (vector
int)__builtin_altivec_vslo(
__a, (vector
int)
__b);
9891 vector
unsigned char __b) {
9892 return (vector
int)__builtin_altivec_vslo(
__a, (vector
int)
__b);
9897 return (vector
unsigned int)__builtin_altivec_vslo((vector
int)
__a,
9903 return (vector
unsigned int)__builtin_altivec_vslo((vector
int)
__a,
9908 vector
signed char __b) {
9909 return (vector
float)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
9913 vector
unsigned char __b) {
9914 return (vector
float)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
9919 vec_slo(vector
signed long long __a, vector
signed char __b) {
9920 return (vector
signed long long)__builtin_altivec_vslo((vector
int)
__a,
9925 vec_slo(vector
signed long long __a, vector
unsigned char __b) {
9926 return (vector
signed long long)__builtin_altivec_vslo((vector
int)
__a,
9930 static __inline__ vector
unsigned long long __ATTRS_o_ai
9931 vec_slo(vector
unsigned long long __a, vector
signed char __b) {
9932 return (vector
unsigned long long)__builtin_altivec_vslo((vector
int)
__a,
9936 static __inline__ vector
unsigned long long __ATTRS_o_ai
9937 vec_slo(vector
unsigned long long __a, vector
unsigned char __b) {
9938 return (vector
unsigned long long)__builtin_altivec_vslo((vector
int)
__a,
9947 return (vector
signed char)__builtin_altivec_vslo((vector
int)
__a,
9953 return (vector
signed char)__builtin_altivec_vslo((vector
int)
__a,
9959 return (vector
unsigned char)__builtin_altivec_vslo((vector
int)
__a,
9965 return (vector
unsigned char)__builtin_altivec_vslo((vector
int)
__a,
9970 vector
signed char __b) {
9971 return (vector
short)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
9975 vector
unsigned char __b) {
9976 return (vector
short)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
9981 return (vector
unsigned short)__builtin_altivec_vslo((vector
int)
__a,
9987 return (vector
unsigned short)__builtin_altivec_vslo((vector
int)
__a,
9992 vector
signed char __b) {
9993 return (vector pixel)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
9997 vector
unsigned char __b) {
9998 return (vector pixel)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
10002 vector
signed char __b) {
10003 return (vector
int)__builtin_altivec_vslo(
__a, (vector
int)
__b);
10007 vector
unsigned char __b) {
10008 return (vector
int)__builtin_altivec_vslo(
__a, (vector
int)
__b);
10013 return (vector
unsigned int)__builtin_altivec_vslo((vector
int)
__a,
10019 return (vector
unsigned int)__builtin_altivec_vslo((vector
int)
__a,
10024 vector
signed char __b) {
10025 return (vector
float)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
10029 vector
unsigned char __b) {
10030 return (vector
float)__builtin_altivec_vslo((vector
int)
__a, (vector
int)
__b);
10052 unsigned char b0 = (
__b & 0x07) * 2;
10053 unsigned char b1 = b0 + 1;
10055 (vector
unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10056 b0, b1, b0, b1, b0, b1));
10061 unsigned char b0 = (
__b & 0x07) * 2;
10062 unsigned char b1 = b0 + 1;
10064 (vector
unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10065 b0, b1, b0, b1, b0, b1));
10070 unsigned char b0 = (
__b & 0x07) * 2;
10071 unsigned char b1 = b0 + 1;
10073 (vector
unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10074 b0, b1, b0, b1, b0, b1));
10078 unsigned const int __b) {
10079 unsigned char b0 = (
__b & 0x07) * 2;
10080 unsigned char b1 = b0 + 1;
10082 (vector
unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10083 b0, b1, b0, b1, b0, b1));
10088 unsigned char b0 = (
__b & 0x03) * 4;
10089 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10091 (vector
unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10092 b2, b3, b0, b1, b2, b3));
10097 unsigned char b0 = (
__b & 0x03) * 4;
10098 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10100 (vector
unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10101 b2, b3, b0, b1, b2, b3));
10106 unsigned char b0 = (
__b & 0x03) * 4;
10107 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10109 (vector
unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10110 b2, b3, b0, b1, b2, b3));
10114 unsigned const int __b) {
10115 unsigned char b0 = (
__b & 0x03) * 4;
10116 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10118 (vector
unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10119 b2, b3, b0, b1, b2, b3));
10124 unsigned const int __b) {
10125 unsigned char b0 = (
__b & 0x01) * 8;
10126 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10127 b6 = b0 + 6, b7 = b0 + 7;
10129 (vector
unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10130 b2, b3, b4, b5, b6, b7));
10134 unsigned char b0 = (
__b & 0x01) * 8;
10135 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10136 b6 = b0 + 6, b7 = b0 + 7;
10138 (vector
unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10139 b2, b3, b4, b5, b6, b7));
10141 static __inline__ vector
signed long long __ATTRS_o_ai
10143 unsigned char b0 = (
__b & 0x01) * 8;
10144 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10145 b6 = b0 + 6, b7 = b0 + 7;
10147 (vector
unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10148 b2, b3, b4, b5, b6, b7));
10150 static __inline__ vector
unsigned long long __ATTRS_o_ai
10152 unsigned char b0 = (
__b & 0x01) * 8;
10153 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10154 b6 = b0 + 6, b7 = b0 + 7;
10156 (vector
unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10157 b2, b3, b4, b5, b6, b7));
10163 #define __builtin_altivec_vspltb vec_vspltb
10176 unsigned char __b) {
10182 #define __builtin_altivec_vsplth vec_vsplth
10185 unsigned char __b) {
10187 unsigned char b1 =
__b + 1;
10189 (vector
unsigned char)(
__b, b1,
__b, b1,
__b, b1,
__b, b1,
10196 unsigned char b1 =
__b + 1;
10198 (vector
unsigned char)(
__b, b1,
__b, b1,
__b, b1,
__b, b1,
10205 unsigned char b1 =
__b + 1;
10207 (vector
unsigned char)(
__b, b1,
__b, b1,
__b, b1,
__b, b1,
10212 unsigned char __b) {
10214 unsigned char b1 =
__b + 1;
10216 (vector
unsigned char)(
__b, b1,
__b, b1,
__b, b1,
__b, b1,
10222 #define __builtin_altivec_vspltw vec_vspltw
10225 unsigned char __b) {
10227 unsigned char b1 =
__b + 1, b2 =
__b + 2, b3 =
__b + 3;
10229 (vector
unsigned char)(
__b, b1, b2, b3,
__b, b1, b2, b3,
__b,
10230 b1, b2, b3,
__b, b1, b2, b3));
10236 unsigned char b1 =
__b + 1, b2 =
__b + 2, b3 =
__b + 3;
10238 (vector
unsigned char)(
__b, b1, b2, b3,
__b, b1, b2, b3,
__b,
10239 b1, b2, b3,
__b, b1, b2, b3));
10243 unsigned char __b) {
10245 unsigned char b1 =
__b + 1, b2 =
__b + 2, b3 =
__b + 3;
10247 (vector
unsigned char)(
__b, b1, b2, b3,
__b, b1, b2, b3,
__b,
10248 b1, b2, b3,
__b, b1, b2, b3));
10252 unsigned char __b) {
10254 unsigned char b1 =
__b + 1, b2 =
__b + 2, b3 =
__b + 3;
10256 (vector
unsigned char)(
__b, b1, b2, b3,
__b, b1, b2, b3,
__b,
10257 b1, b2, b3,
__b, b1, b2, b3));
10262 #define __builtin_altivec_vspltisb vec_splat_s8
10267 return (vector
signed char)(
__a);
10275 return (vector
signed char)(
__a);
10280 #define __builtin_altivec_vspltish vec_splat_s16
10284 return (vector
short)(
__a);
10291 return (vector
short)(
__a);
10296 #define __builtin_altivec_vspltisw vec_splat_s32
10300 return (vector
int)(
__a);
10307 return (vector
int)(
__a);
10315 return (vector
unsigned char)(
__a);
10323 return (vector
unsigned short)(
__a);
10331 return (vector
unsigned int)(
__a);
10341 (
__b % (vector
unsigned char)(
sizeof(
unsigned char) * __CHAR_BIT__));
10346 return (vector
signed char)
vec_sr((vector
unsigned char)
__a,
__b);
10352 (
__b % (vector
unsigned short)(
sizeof(
unsigned short) * __CHAR_BIT__));
10356 vector
unsigned short __b) {
10357 return (vector
short)
vec_sr((vector
unsigned short)
__a,
__b);
10363 (
__b % (vector
unsigned int)(
sizeof(
unsigned int) * __CHAR_BIT__));
10367 vector
unsigned int __b) {
10368 return (vector
int)
vec_sr((vector
unsigned int)
__a,
__b);
10371 #ifdef __POWER8_VECTOR__
10372 static __inline__ vector
unsigned long long __ATTRS_o_ai
10373 vec_sr(vector
unsigned long long __a, vector
unsigned long long __b) {
10374 return __a >> (
__b % (vector
unsigned long long)(
sizeof(
unsigned long long) *
10379 vec_sr(vector
long long __a, vector
unsigned long long __b) {
10380 return (vector
long long)
vec_sr((vector
unsigned long long)
__a,
__b);
10382 #elif defined(__VSX__)
10383 static __inline__ vector
unsigned long long __ATTRS_o_ai
10384 vec_sr(vector
unsigned long long __a, vector
unsigned long long __b) {
10385 __b %= (vector
unsigned long long)(
sizeof(
unsigned long long) * __CHAR_BIT__);
10391 vector
unsigned long long __swapshift =
10392 __builtin_shufflevector(
__b,
__b, 1, 0);
10393 vector
unsigned long long __leftelt =
10394 (vector
unsigned long long)__builtin_altivec_vsro(
10395 (vector
signed int)
__a, (vector
signed int)__swapshift);
10396 #ifdef __LITTLE_ENDIAN__
10397 __leftelt = (vector
unsigned long long)__builtin_altivec_vsr(
10398 (vector
signed int)__leftelt,
10399 (vector
signed int)
vec_vspltb((vector
unsigned char)__swapshift, 0));
10401 __leftelt = (vector
unsigned long long)__builtin_altivec_vsr(
10402 (vector
signed int)__leftelt,
10403 (vector
signed int)
vec_vspltb((vector
unsigned char)__swapshift, 15));
10405 __a = __builtin_shufflevector(
__a,
__a, 1, 0);
10406 vector
unsigned long long __rightelt =
10407 (vector
unsigned long long)__builtin_altivec_vsro((vector
signed int)
__a,
10408 (vector
signed int)
__b);
10409 #ifdef __LITTLE_ENDIAN__
10410 __rightelt = (vector
unsigned long long)__builtin_altivec_vsr(
10411 (vector
signed int)__rightelt,
10413 return __builtin_shufflevector(__rightelt, __leftelt, 1, 3);
10415 __rightelt = (vector
unsigned long long)__builtin_altivec_vsr(
10416 (vector
signed int)__rightelt,
10418 return __builtin_shufflevector(__leftelt, __rightelt, 0, 2);
10423 vec_sr(vector
long long __a, vector
unsigned long long __b) {
10424 return (vector
long long)
vec_sr((vector
unsigned long long)
__a,
__b);
10430 #define __builtin_altivec_vsrb vec_vsrb
10444 #define __builtin_altivec_vsrh vec_vsrh
10458 #define __builtin_altivec_vsrw vec_vsrw
10461 vector
unsigned int __b) {
10474 return (vector
signed char)__builtin_altivec_vsrab((vector
char)
__a,
__b);
10479 return (vector
unsigned char)__builtin_altivec_vsrab((vector
char)
__a,
__b);
10483 vector
unsigned short __b) {
10484 return __builtin_altivec_vsrah(
__a, (vector
unsigned short)
__b);
10489 return (vector
unsigned short)__builtin_altivec_vsrah((vector
short)
__a,
__b);
10493 vector
unsigned int __b) {
10494 return __builtin_altivec_vsraw(
__a,
__b);
10499 return (vector
unsigned int)__builtin_altivec_vsraw((vector
int)
__a,
__b);
10502 #ifdef __POWER8_VECTOR__
10503 static __inline__ vector
signed long long __ATTRS_o_ai
10504 vec_sra(vector
signed long long __a, vector
unsigned long long __b) {
10508 static __inline__ vector
unsigned long long __ATTRS_o_ai
10509 vec_sra(vector
unsigned long long __a, vector
unsigned long long __b) {
10510 return (vector
unsigned long long)((vector
signed long long)
__a >>
__b);
10512 #elif defined(__VSX__)
10513 static __inline__ vector
signed long long __ATTRS_o_ai
10514 vec_sra(vector
signed long long __a, vector
unsigned long long __b) {
10515 __b %= (vector
unsigned long long)(
sizeof(
unsigned long long) * __CHAR_BIT__);
10519 static __inline__ vector
unsigned long long __ATTRS_o_ai
10520 vec_sra(vector
unsigned long long __a, vector
unsigned long long __b) {
10521 __b %= (vector
unsigned long long)(
sizeof(
unsigned long long) * __CHAR_BIT__);
10522 return (vector
unsigned long long)((vector
signed long long)
__a >>
__b);
10530 return (vector
signed char)__builtin_altivec_vsrab((vector
char)
__a,
__b);
10535 return (vector
unsigned char)__builtin_altivec_vsrab((vector
char)
__a,
__b);
10542 return __builtin_altivec_vsrah(
__a, (vector
unsigned short)
__b);
10547 return (vector
unsigned short)__builtin_altivec_vsrah((vector
short)
__a,
__b);
10553 vector
unsigned int __b) {
10554 return __builtin_altivec_vsraw(
__a,
__b);
10559 return (vector
unsigned int)__builtin_altivec_vsraw((vector
int)
__a,
__b);
10566 return (vector
signed char)__builtin_altivec_vsr((vector
int)
__a,
10572 return (vector
signed char)__builtin_altivec_vsr((vector
int)
__a,
10578 return (vector
signed char)__builtin_altivec_vsr((vector
int)
__a,
10584 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)
__a,
10590 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)
__a,
10596 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)
__a,
10602 return (vector
bool char)__builtin_altivec_vsr((vector
int)
__a,
10608 return (vector
bool char)__builtin_altivec_vsr((vector
int)
__a,
10614 return (vector
bool char)__builtin_altivec_vsr((vector
int)
__a,
10619 vector
unsigned char __b) {
10620 return (vector
short)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10624 vector
unsigned short __b) {
10625 return (vector
short)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10629 vector
unsigned int __b) {
10630 return (vector
short)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10635 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)
__a,
10641 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)
__a,
10647 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)
__a,
10653 return (vector
bool short)__builtin_altivec_vsr((vector
int)
__a,
10659 return (vector
bool short)__builtin_altivec_vsr((vector
int)
__a,
10665 return (vector
bool short)__builtin_altivec_vsr((vector
int)
__a,
10670 vector
unsigned char __b) {
10671 return (vector pixel)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10675 vector
unsigned short __b) {
10676 return (vector pixel)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10680 vector
unsigned int __b) {
10681 return (vector pixel)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10685 vector
unsigned char __b) {
10686 return (vector
int)__builtin_altivec_vsr(
__a, (vector
int)
__b);
10690 vector
unsigned short __b) {
10691 return (vector
int)__builtin_altivec_vsr(
__a, (vector
int)
__b);
10695 vector
unsigned int __b) {
10696 return (vector
int)__builtin_altivec_vsr(
__a, (vector
int)
__b);
10701 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)
__a,
10707 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)
__a,
10713 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)
__a,
10719 return (vector
bool int)__builtin_altivec_vsr((vector
int)
__a,
10725 return (vector
bool int)__builtin_altivec_vsr((vector
int)
__a,
10731 return (vector
bool int)__builtin_altivec_vsr((vector
int)
__a,
10736 static __inline__ vector
signed long long __ATTRS_o_ai
10737 vec_srl(vector
signed long long __a, vector
unsigned char __b) {
10738 return (vector
signed long long)__builtin_altivec_vsr((vector
int)
__a,
10742 static __inline__ vector
unsigned long long __ATTRS_o_ai
10743 vec_srl(vector
unsigned long long __a, vector
unsigned char __b) {
10744 return (vector
unsigned long long)__builtin_altivec_vsr((vector
int)
__a,
10753 return (vector
signed char)__builtin_altivec_vsr((vector
int)
__a,
10759 return (vector
signed char)__builtin_altivec_vsr((vector
int)
__a,
10765 return (vector
signed char)__builtin_altivec_vsr((vector
int)
__a,
10771 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)
__a,
10777 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)
__a,
10783 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)
__a,
10789 return (vector
bool char)__builtin_altivec_vsr((vector
int)
__a,
10795 return (vector
bool char)__builtin_altivec_vsr((vector
int)
__a,
10801 return (vector
bool char)__builtin_altivec_vsr((vector
int)
__a,
10806 vector
unsigned char __b) {
10807 return (vector
short)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10811 vector
unsigned short __b) {
10812 return (vector
short)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10816 vector
unsigned int __b) {
10817 return (vector
short)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10822 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)
__a,
10828 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)
__a,
10834 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)
__a,
10840 return (vector
bool short)__builtin_altivec_vsr((vector
int)
__a,
10846 return (vector
bool short)__builtin_altivec_vsr((vector
int)
__a,
10852 return (vector
bool short)__builtin_altivec_vsr((vector
int)
__a,
10857 vector
unsigned char __b) {
10858 return (vector pixel)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10862 vector
unsigned short __b) {
10863 return (vector pixel)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10867 vector
unsigned int __b) {
10868 return (vector pixel)__builtin_altivec_vsr((vector
int)
__a, (vector
int)
__b);
10872 vector
unsigned char __b) {
10873 return (vector
int)__builtin_altivec_vsr(
__a, (vector
int)
__b);
10877 vector
unsigned short __b) {
10878 return (vector
int)__builtin_altivec_vsr(
__a, (vector
int)
__b);
10882 vector
unsigned int __b) {
10883 return (vector
int)__builtin_altivec_vsr(
__a, (vector
int)
__b);
10888 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)
__a,
10894 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)
__a,
10900 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)
__a,
10906 return (vector
bool int)__builtin_altivec_vsr((vector
int)
__a,
10912 return (vector
bool int)__builtin_altivec_vsr((vector
int)
__a,
10918 return (vector
bool int)__builtin_altivec_vsr((vector
int)
__a,
10926 return (vector
signed char)__builtin_altivec_vsro((vector
int)
__a,
10932 return (vector
signed char)__builtin_altivec_vsro((vector
int)
__a,
10938 return (vector
unsigned char)__builtin_altivec_vsro((vector
int)
__a,
10944 return (vector
unsigned char)__builtin_altivec_vsro((vector
int)
__a,
10949 vector
signed char __b) {
10950 return (vector
short)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
10954 vector
unsigned char __b) {
10955 return (vector
short)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
10960 return (vector
unsigned short)__builtin_altivec_vsro((vector
int)
__a,
10966 return (vector
unsigned short)__builtin_altivec_vsro((vector
int)
__a,
10971 vector
signed char __b) {
10972 return (vector pixel)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
10976 vector
unsigned char __b) {
10977 return (vector pixel)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
10981 vector
signed char __b) {
10982 return (vector
int)__builtin_altivec_vsro(
__a, (vector
int)
__b);
10986 vector
unsigned char __b) {
10987 return (vector
int)__builtin_altivec_vsro(
__a, (vector
int)
__b);
10992 return (vector
unsigned int)__builtin_altivec_vsro((vector
int)
__a,
10998 return (vector
unsigned int)__builtin_altivec_vsro((vector
int)
__a,
11003 vector
signed char __b) {
11004 return (vector
float)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
11008 vector
unsigned char __b) {
11009 return (vector
float)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
11013 static __inline__ vector
signed long long __ATTRS_o_ai
11014 vec_sro(vector
signed long long __a, vector
signed char __b) {
11015 return (vector
signed long long)__builtin_altivec_vsro((vector
int)
__a,
11019 static __inline__ vector
signed long long __ATTRS_o_ai
11020 vec_sro(vector
signed long long __a, vector
unsigned char __b) {
11021 return (vector
signed long long)__builtin_altivec_vsro((vector
int)
__a,
11025 static __inline__ vector
unsigned long long __ATTRS_o_ai
11026 vec_sro(vector
unsigned long long __a, vector
signed char __b) {
11027 return (vector
unsigned long long)__builtin_altivec_vsro((vector
int)
__a,
11031 static __inline__ vector
unsigned long long __ATTRS_o_ai
11032 vec_sro(vector
unsigned long long __a, vector
unsigned char __b) {
11033 return (vector
unsigned long long)__builtin_altivec_vsro((vector
int)
__a,
11042 return (vector
signed char)__builtin_altivec_vsro((vector
int)
__a,
11048 return (vector
signed char)__builtin_altivec_vsro((vector
int)
__a,
11054 return (vector
unsigned char)__builtin_altivec_vsro((vector
int)
__a,
11060 return (vector
unsigned char)__builtin_altivec_vsro((vector
int)
__a,
11065 vector
signed char __b) {
11066 return (vector
short)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
11070 vector
unsigned char __b) {
11071 return (vector
short)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
11076 return (vector
unsigned short)__builtin_altivec_vsro((vector
int)
__a,
11082 return (vector
unsigned short)__builtin_altivec_vsro((vector
int)
__a,
11087 vector
signed char __b) {
11088 return (vector pixel)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
11092 vector
unsigned char __b) {
11093 return (vector pixel)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
11097 vector
signed char __b) {
11098 return (vector
int)__builtin_altivec_vsro(
__a, (vector
int)
__b);
11102 vector
unsigned char __b) {
11103 return (vector
int)__builtin_altivec_vsro(
__a, (vector
int)
__b);
11108 return (vector
unsigned int)__builtin_altivec_vsro((vector
int)
__a,
11114 return (vector
unsigned int)__builtin_altivec_vsro((vector
int)
__a,
11119 vector
signed char __b) {
11120 return (vector
float)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
11124 vector
unsigned char __b) {
11125 return (vector
float)__builtin_altivec_vsro((vector
int)
__a, (vector
int)
__b);
11131 vector
signed char *
__c) {
11132 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11136 signed char *
__c) {
11137 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11141 vector
unsigned char *
__c) {
11142 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11146 unsigned char *
__c) {
11147 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11151 signed char *
__c) {
11152 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11156 unsigned char *
__c) {
11157 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11161 vector
bool char *
__c) {
11162 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11166 vector
short *
__c) {
11167 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11172 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11176 vector
unsigned short *
__c) {
11177 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11181 unsigned short *
__c) {
11182 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11187 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11191 unsigned short *
__c) {
11192 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11196 vector
bool short *
__c) {
11197 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11202 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11206 unsigned short *
__c) {
11207 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11211 vector pixel *
__c) {
11212 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11225 vector
unsigned int *
__c) {
11226 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11230 unsigned int *
__c) {
11231 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11236 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11240 unsigned int *
__c) {
11241 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11245 vector
bool int *
__c) {
11246 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11250 vector
float *
__c) {
11251 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11256 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11262 vector
signed char *
__c) {
11263 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11267 signed char *
__c) {
11268 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11272 vector
unsigned char *
__c) {
11273 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11277 unsigned char *
__c) {
11278 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11282 signed char *
__c) {
11283 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11287 unsigned char *
__c) {
11288 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11292 vector
bool char *
__c) {
11293 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11297 vector
short *
__c) {
11298 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11303 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11307 vector
unsigned short *
__c) {
11308 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11312 unsigned short *
__c) {
11313 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11318 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11322 unsigned short *
__c) {
11323 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11327 vector
bool short *
__c) {
11328 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11333 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11337 unsigned short *
__c) {
11338 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11342 vector pixel *
__c) {
11343 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11357 vector
unsigned int *
__c) {
11358 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11362 unsigned int *
__c) {
11363 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11368 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11372 unsigned int *
__c) {
11373 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11377 vector
bool int *
__c) {
11378 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11382 vector
float *
__c) {
11383 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11388 __builtin_altivec_stvx((vector
int)
__a,
__b,
__c);
11394 signed char *
__c) {
11395 __builtin_altivec_stvebx((vector
char)
__a,
__b,
__c);
11399 unsigned char *
__c) {
11400 __builtin_altivec_stvebx((vector
char)
__a,
__b,
__c);
11404 signed char *
__c) {
11405 __builtin_altivec_stvebx((vector
char)
__a,
__b,
__c);
11409 unsigned char *
__c) {
11410 __builtin_altivec_stvebx((vector
char)
__a,
__b,
__c);
11415 __builtin_altivec_stvehx(
__a,
__b,
__c);
11419 unsigned short *
__c) {
11420 __builtin_altivec_stvehx((vector
short)
__a,
__b,
__c);
11425 __builtin_altivec_stvehx((vector
short)
__a,
__b,
__c);
11429 unsigned short *
__c) {
11430 __builtin_altivec_stvehx((vector
short)
__a,
__b,
__c);
11435 __builtin_altivec_stvehx((vector
short)
__a,
__b,
__c);
11439 unsigned short *
__c) {
11440 __builtin_altivec_stvehx((vector
short)
__a,
__b,
__c);
11444 __builtin_altivec_stvewx(
__a,
__b,
__c);
11448 unsigned int *
__c) {
11449 __builtin_altivec_stvewx((vector
int)
__a,
__b,
__c);
11454 __builtin_altivec_stvewx((vector
int)
__a,
__b,
__c);
11458 unsigned int *
__c) {
11459 __builtin_altivec_stvewx((vector
int)
__a,
__b,
__c);
11464 __builtin_altivec_stvewx((vector
int)
__a,
__b,
__c);
11470 signed char *
__c) {
11471 __builtin_altivec_stvebx((vector
char)
__a,
__b,
__c);
11475 long __b,
unsigned char *
__c) {
11476 __builtin_altivec_stvebx((vector
char)
__a,
__b,
__c);
11480 signed char *
__c) {
11481 __builtin_altivec_stvebx((vector
char)
__a,
__b,
__c);
11485 unsigned char *
__c) {
11486 __builtin_altivec_stvebx((vector
char)
__a,
__b,
__c);
11493 __builtin_altivec_stvehx(
__a,
__b,
__c);
11497 long __b,
unsigned short *
__c) {
11498 __builtin_altivec_stvehx((vector
short)
__a,
__b,
__c);
11503 __builtin_altivec_stvehx((vector
short)
__a,
__b,
__c);
11507 unsigned short *
__c) {
11508 __builtin_altivec_stvehx((vector
short)
__a,
__b,
__c);
11513 __builtin_altivec_stvehx((vector
short)
__a,
__b,
__c);
11517 unsigned short *
__c) {
11518 __builtin_altivec_stvehx((vector
short)
__a,
__b,
__c);
11525 __builtin_altivec_stvewx(
__a,
__b,
__c);
11529 unsigned int *
__c) {
11530 __builtin_altivec_stvewx((vector
int)
__a,
__b,
__c);
11535 __builtin_altivec_stvewx((vector
int)
__a,
__b,
__c);
11539 unsigned int *
__c) {
11540 __builtin_altivec_stvewx((vector
int)
__a,
__b,
__c);
11545 __builtin_altivec_stvewx((vector
int)
__a,
__b,
__c);
11551 vector
signed char *
__c) {
11552 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11556 signed char *
__c) {
11557 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11561 vector
unsigned char *
__c) {
11562 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11566 unsigned char *
__c) {
11567 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11571 signed char *
__c) {
11572 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11576 unsigned char *
__c) {
11577 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11581 vector
bool char *
__c) {
11582 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11586 vector
short *
__c) {
11587 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11592 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11596 vector
unsigned short *
__c) {
11597 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11601 unsigned short *
__c) {
11602 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11607 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11611 unsigned short *
__c) {
11612 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11616 vector
bool short *
__c) {
11617 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11622 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11626 unsigned short *
__c) {
11627 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11631 vector pixel *
__c) {
11632 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11637 __builtin_altivec_stvxl(
__a,
__b,
__c);
11641 __builtin_altivec_stvxl(
__a,
__b,
__c);
11645 vector
unsigned int *
__c) {
11646 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11650 unsigned int *
__c) {
11651 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11656 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11660 unsigned int *
__c) {
11661 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11665 vector
bool int *
__c) {
11666 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11670 vector
float *
__c) {
11671 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11676 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11682 vector
signed char *
__c) {
11683 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11687 signed char *
__c) {
11688 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11692 vector
unsigned char *
__c) {
11693 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11697 unsigned char *
__c) {
11698 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11702 signed char *
__c) {
11703 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11707 unsigned char *
__c) {
11708 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11712 vector
bool char *
__c) {
11713 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11717 vector
short *
__c) {
11718 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11723 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11728 vector
unsigned short *
__c) {
11729 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11733 int __b,
unsigned short *
__c) {
11734 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11739 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11743 unsigned short *
__c) {
11744 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11748 vector
bool short *
__c) {
11749 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11754 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11758 unsigned short *
__c) {
11759 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11763 vector pixel *
__c) {
11764 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11769 __builtin_altivec_stvxl(
__a,
__b,
__c);
11774 __builtin_altivec_stvxl(
__a,
__b,
__c);
11778 vector
unsigned int *
__c) {
11779 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11783 unsigned int *
__c) {
11784 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11789 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11793 unsigned int *
__c) {
11794 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11798 vector
bool int *
__c) {
11799 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11803 vector
float *
__c) {
11804 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11809 __builtin_altivec_stvxl((vector
int)
__a,
__b,
__c);
11821 return (vector
signed char)
__a -
__b;
11826 return __a - (vector
signed char)
__b;
11836 return (vector
unsigned char)
__a -
__b;
11841 return __a - (vector
unsigned char)
__b;
11845 vector
short __b) {
11850 vector
short __b) {
11851 return (vector
short)
__a -
__b;
11855 vector
bool short __b) {
11856 return __a - (vector short)
__b;
11866 return (vector
unsigned short)
__a -
__b;
11871 return __a - (vector
unsigned short)
__b;
11881 return (vector
int)
__a -
__b;
11885 vector
bool int __b) {
11896 return (vector
unsigned int)
__a -
__b;
11904 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
11905 defined(__SIZEOF_INT128__)
11907 vec_sub(vector
signed __int128
__a, vector
signed __int128
__b) {
11911 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
11912 vec_sub(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
11915 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__) &&
11919 static __inline__ vector
signed long long __ATTRS_o_ai
11920 vec_sub(vector
signed long long __a, vector
signed long long __b) {
11924 static __inline__ vector
unsigned long long __ATTRS_o_ai
11925 vec_sub(vector
unsigned long long __a, vector
unsigned long long __b) {
11930 vector
double __b) {
11936 vector
float __b) {
11942 #define __builtin_altivec_vsububm vec_vsububm
11951 return (vector
signed char)
__a -
__b;
11956 return __a - (vector
signed char)
__b;
11966 return (vector
unsigned char)
__a -
__b;
11971 return __a - (vector
unsigned char)
__b;
11976 #define __builtin_altivec_vsubuhm vec_vsubuhm
11979 vector
short __b) {
11984 vector
short __b) {
11985 return (vector
short)
__a -
__b;
11989 vector
bool short __b) {
11990 return __a - (vector short)
__b;
12000 return (vector
unsigned short)
__a -
__b;
12005 return __a - (vector
unsigned short)
__b;
12010 #define __builtin_altivec_vsubuwm vec_vsubuwm
12019 return (vector
int)
__a -
__b;
12023 vector
bool int __b) {
12034 return (vector
unsigned int)
__a -
__b;
12044 #define __builtin_altivec_vsubfp vec_vsubfp
12046 static __inline__ vector
float __attribute__((__always_inline__))
12047 vec_vsubfp(vector
float __a, vector
float __b) {
12055 return (vector
signed int)__builtin_altivec_vsubcuw((vector
unsigned int)
__a,
12056 (vector
unsigned int)
__b);
12061 return __builtin_altivec_vsubcuw(
__a,
__b);
12064 #ifdef __POWER8_VECTOR__
12065 #ifdef __SIZEOF_INT128__
12066 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
12067 vec_subc(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
12068 return __builtin_altivec_vsubcuq(
__a,
__b);
12072 vec_subc(vector
signed __int128
__a, vector
signed __int128
__b) {
12073 return __builtin_altivec_vsubcuq(
__a,
__b);
12077 static __inline__ vector
unsigned char __attribute__((__always_inline__))
12078 vec_subc_u128(vector
unsigned char __a, vector
unsigned char __b) {
12079 return (vector
unsigned char)__builtin_altivec_vsubcuq(
__a,
__b);
12081 #endif // __POWER8_VECTOR__
12085 static __inline__ vector
unsigned int __attribute__((__always_inline__))
12086 vec_vsubcuw(vector
unsigned int __a, vector
unsigned int __b) {
12087 return __builtin_altivec_vsubcuw(
__a,
__b);
12094 return __builtin_altivec_vsubsbs(
__a,
__b);
12099 return __builtin_altivec_vsubsbs((vector
signed char)
__a,
__b);
12104 return __builtin_altivec_vsubsbs(
__a, (vector
signed char)
__b);
12109 return __builtin_altivec_vsububs(
__a,
__b);
12114 return __builtin_altivec_vsububs((vector
unsigned char)
__a,
__b);
12119 return __builtin_altivec_vsububs(
__a, (vector
unsigned char)
__b);
12123 vector
short __b) {
12124 return __builtin_altivec_vsubshs(
__a,
__b);
12128 vector
short __b) {
12129 return __builtin_altivec_vsubshs((vector
short)
__a,
__b);
12133 vector
bool short __b) {
12134 return __builtin_altivec_vsubshs(
__a, (vector
short)
__b);
12139 return __builtin_altivec_vsubuhs(
__a,
__b);
12144 return __builtin_altivec_vsubuhs((vector
unsigned short)
__a,
__b);
12149 return __builtin_altivec_vsubuhs(
__a, (vector
unsigned short)
__b);
12154 return __builtin_altivec_vsubsws(
__a,
__b);
12159 return __builtin_altivec_vsubsws((vector
int)
__a,
__b);
12163 vector
bool int __b) {
12164 return __builtin_altivec_vsubsws(
__a, (vector
int)
__b);
12169 return __builtin_altivec_vsubuws(
__a,
__b);
12174 return __builtin_altivec_vsubuws((vector
unsigned int)
__a,
__b);
12179 return __builtin_altivec_vsubuws(
__a, (vector
unsigned int)
__b);
12186 return __builtin_altivec_vsubsbs(
__a,
__b);
12191 return __builtin_altivec_vsubsbs((vector
signed char)
__a,
__b);
12196 return __builtin_altivec_vsubsbs(
__a, (vector
signed char)
__b);
12203 return __builtin_altivec_vsububs(
__a,
__b);
12208 return __builtin_altivec_vsububs((vector
unsigned char)
__a,
__b);
12213 return __builtin_altivec_vsububs(
__a, (vector
unsigned char)
__b);
12219 vector
short __b) {
12220 return __builtin_altivec_vsubshs(
__a,
__b);
12224 vector
short __b) {
12225 return __builtin_altivec_vsubshs((vector
short)
__a,
__b);
12229 vector
bool short __b) {
12230 return __builtin_altivec_vsubshs(
__a, (vector
short)
__b);
12237 return __builtin_altivec_vsubuhs(
__a,
__b);
12242 return __builtin_altivec_vsubuhs((vector
unsigned short)
__a,
__b);
12247 return __builtin_altivec_vsubuhs(
__a, (vector
unsigned short)
__b);
12254 return __builtin_altivec_vsubsws(
__a,
__b);
12259 return __builtin_altivec_vsubsws((vector
int)
__a,
__b);
12263 vector
bool int __b) {
12264 return __builtin_altivec_vsubsws(
__a, (vector
int)
__b);
12271 return __builtin_altivec_vsubuws(
__a,
__b);
12276 return __builtin_altivec_vsubuws((vector
unsigned int)
__a,
__b);
12281 return __builtin_altivec_vsubuws(
__a, (vector
unsigned int)
__b);
12284 #ifdef __POWER8_VECTOR__
12287 #ifdef __SIZEOF_INT128__
12289 vec_vsubuqm(vector
signed __int128
__a, vector
signed __int128
__b) {
12293 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
12294 vec_vsubuqm(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
12299 static __inline__ vector
unsigned char __attribute__((__always_inline__))
12300 vec_sub_u128(vector
unsigned char __a, vector
unsigned char __b) {
12301 return __builtin_altivec_vsubuqm(
__a,
__b);
12306 #ifdef __SIZEOF_INT128__
12308 vec_vsubeuqm(vector
signed __int128
__a, vector
signed __int128
__b,
12309 vector
signed __int128
__c) {
12310 return __builtin_altivec_vsubeuqm(
__a,
__b,
__c);
12313 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
12314 vec_vsubeuqm(vector
unsigned __int128
__a, vector
unsigned __int128
__b,
12315 vector
unsigned __int128
__c) {
12316 return __builtin_altivec_vsubeuqm(
__a,
__b,
__c);
12320 vec_sube(vector
signed __int128
__a, vector
signed __int128
__b,
12321 vector
signed __int128
__c) {
12322 return __builtin_altivec_vsubeuqm(
__a,
__b,
__c);
12325 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
12326 vec_sube(vector
unsigned __int128
__a, vector
unsigned __int128
__b,
12327 vector
unsigned __int128
__c) {
12328 return __builtin_altivec_vsubeuqm(
__a,
__b,
__c);
12332 static __inline__ vector
unsigned char __attribute__((__always_inline__))
12333 vec_sube_u128(vector
unsigned char __a, vector
unsigned char __b,
12334 vector
unsigned char __c) {
12335 return (vector
unsigned char)__builtin_altivec_vsubeuqm(
__a,
__b,
__c);
12340 #ifdef __SIZEOF_INT128__
12342 vec_vsubcuq(vector
signed __int128
__a, vector
signed __int128
__b) {
12343 return __builtin_altivec_vsubcuq(
__a,
__b);
12346 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
12347 vec_vsubcuq(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
12348 return __builtin_altivec_vsubcuq(
__a,
__b);
12354 vec_vsubecuq(vector
signed __int128
__a, vector
signed __int128
__b,
12355 vector
signed __int128
__c) {
12356 return __builtin_altivec_vsubecuq(
__a,
__b,
__c);
12359 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
12360 vec_vsubecuq(vector
unsigned __int128
__a, vector
unsigned __int128
__b,
12361 vector
unsigned __int128
__c) {
12362 return __builtin_altivec_vsubecuq(
__a,
__b,
__c);
12366 #ifdef __powerpc64__
12368 vec_subec(vector
signed int __a, vector
signed int __b,
12369 vector
signed int __c) {
12374 vec_subec(vector
unsigned int __a, vector
unsigned int __b,
12375 vector
unsigned int __c) {
12380 #ifdef __SIZEOF_INT128__
12382 vec_subec(vector
signed __int128
__a, vector
signed __int128
__b,
12383 vector
signed __int128
__c) {
12384 return __builtin_altivec_vsubecuq(
__a,
__b,
__c);
12387 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
12388 vec_subec(vector
unsigned __int128
__a, vector
unsigned __int128
__b,
12389 vector
unsigned __int128
__c) {
12390 return __builtin_altivec_vsubecuq(
__a,
__b,
__c);
12394 static __inline__ vector
unsigned char __attribute__((__always_inline__))
12395 vec_subec_u128(vector
unsigned char __a, vector
unsigned char __b,
12396 vector
unsigned char __c) {
12397 return (vector
unsigned char)__builtin_altivec_vsubecuq(
__a,
__b,
__c);
12399 #endif // __POWER8_VECTOR__
12403 vector
signed int __c) {
12404 vector
signed int __mask = {1, 1, 1, 1};
12405 vector
signed int __carry =
__c & __mask;
12411 vector
unsigned int __c) {
12412 vector
unsigned int __mask = {1, 1, 1, 1};
12413 vector
unsigned int __carry =
__c & __mask;
12420 return __builtin_altivec_vsum4sbs(
__a,
__b);
12425 return __builtin_altivec_vsum4ubs(
__a,
__b);
12430 return __builtin_altivec_vsum4shs(
__a,
__b);
12435 static __inline__ vector
int __attribute__((__always_inline__))
12436 vec_vsum4sbs(vector
signed char __a, vector
int __b) {
12437 return __builtin_altivec_vsum4sbs(
__a,
__b);
12442 static __inline__ vector
unsigned int __attribute__((__always_inline__))
12443 vec_vsum4ubs(vector
unsigned char __a, vector
unsigned int __b) {
12444 return __builtin_altivec_vsum4ubs(
__a,
__b);
12449 static __inline__ vector
int __attribute__((__always_inline__))
12450 vec_vsum4shs(vector
signed short __a, vector
int __b) {
12451 return __builtin_altivec_vsum4shs(
__a,
__b);
12462 static __inline__ vector
signed int __attribute__((__always_inline__))
12463 vec_sum2s(vector
int __a, vector
int __b) {
12464 #ifdef __LITTLE_ENDIAN__
12466 __b,
__b, (vector
unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12468 __c = __builtin_altivec_vsum2sws(
__a,
__c);
12469 return (vector
signed int)
vec_perm(
12470 __c,
__c, (vector
unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12473 return __builtin_altivec_vsum2sws(
__a,
__b);
12479 static __inline__ vector
signed int __attribute__((__always_inline__))
12480 vec_vsum2sws(vector
int __a, vector
int __b) {
12481 #ifdef __LITTLE_ENDIAN__
12483 __b,
__b, (vector
unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12485 __c = __builtin_altivec_vsum2sws(
__a,
__c);
12486 return (vector
signed int)
vec_perm(
12487 __c,
__c, (vector
unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12490 return __builtin_altivec_vsum2sws(
__a,
__b);
12502 static __inline__ vector
signed int __attribute__((__always_inline__))
12503 vec_sums(vector
signed int __a, vector
signed int __b) {
12504 #ifdef __LITTLE_ENDIAN__
12506 __b = __builtin_altivec_vsumsws(
__a,
__b);
12507 return (vector
signed int)(0, 0, 0,
__b[0]);
12509 return __builtin_altivec_vsumsws(
__a,
__b);
12515 static __inline__ vector
signed int __attribute__((__always_inline__))
12516 vec_vsumsws(vector
signed int __a, vector
signed int __b) {
12517 #ifdef __LITTLE_ENDIAN__
12519 __b = __builtin_altivec_vsumsws(
__a,
__b);
12520 return (vector
signed int)(0, 0, 0,
__b[0]);
12522 return __builtin_altivec_vsumsws(
__a,
__b);
12530 return __builtin_vsx_xvrspiz(
__a);
12532 return __builtin_altivec_vrfiz(
__a);
12538 return __builtin_vsx_xvrdpiz(
__a);
12555 static __inline__ vector
float __attribute__((__always_inline__))
12556 vec_vrfiz(vector
float __a) {
12557 return __builtin_altivec_vrfiz(
__a);
12564 #ifdef __LITTLE_ENDIAN__
12565 #define vec_vupkhpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12566 #define vec_vupklpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12568 #define vec_vupkhpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12569 #define vec_vupklpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12574 #ifdef __LITTLE_ENDIAN__
12575 return __builtin_altivec_vupklsb((vector
char)
__a);
12577 return __builtin_altivec_vupkhsb((vector
char)
__a);
12583 #ifdef __LITTLE_ENDIAN__
12584 return (vector
bool short)__builtin_altivec_vupklsb((vector
char)
__a);
12586 return (vector
bool short)__builtin_altivec_vupkhsb((vector
char)
__a);
12591 #ifdef __LITTLE_ENDIAN__
12592 return __builtin_altivec_vupklsh(
__a);
12594 return __builtin_altivec_vupkhsh(
__a);
12600 #ifdef __LITTLE_ENDIAN__
12601 return (vector
bool int)__builtin_altivec_vupklsh((vector
short)
__a);
12603 return (vector
bool int)__builtin_altivec_vupkhsh((vector
short)
__a);
12609 #ifdef __LITTLE_ENDIAN__
12610 return (vector
unsigned int)__builtin_altivec_vupklpx((vector
short)
__a);
12612 return (vector
unsigned int)__builtin_altivec_vupkhpx((vector
short)
__a);
12616 #ifdef __POWER8_VECTOR__
12618 #ifdef __LITTLE_ENDIAN__
12619 return __builtin_altivec_vupklsw(
__a);
12621 return __builtin_altivec_vupkhsw(
__a);
12627 #ifdef __LITTLE_ENDIAN__
12628 return (vector
bool long long)__builtin_altivec_vupklsw((vector
int)
__a);
12630 return (vector
bool long long)__builtin_altivec_vupkhsw((vector
int)
__a);
12636 return (vector
double)(
__a[0],
__a[1]);
12644 #ifdef __LITTLE_ENDIAN__
12645 return __builtin_altivec_vupklsb((vector
char)
__a);
12647 return __builtin_altivec_vupkhsb((vector
char)
__a);
12653 #ifdef __LITTLE_ENDIAN__
12654 return (vector
bool short)__builtin_altivec_vupklsb((vector
char)
__a);
12656 return (vector
bool short)__builtin_altivec_vupkhsb((vector
char)
__a);
12663 #ifdef __LITTLE_ENDIAN__
12664 return __builtin_altivec_vupklsh(
__a);
12666 return __builtin_altivec_vupkhsh(
__a);
12672 #ifdef __LITTLE_ENDIAN__
12673 return (vector
bool int)__builtin_altivec_vupklsh((vector
short)
__a);
12675 return (vector
bool int)__builtin_altivec_vupkhsh((vector
short)
__a);
12681 #ifdef __LITTLE_ENDIAN__
12682 return (vector
unsigned int)__builtin_altivec_vupklpx((vector
short)
__a);
12684 return (vector
unsigned int)__builtin_altivec_vupkhpx((vector
short)
__a);
12690 #ifdef __POWER8_VECTOR__
12691 static __inline__ vector
long long __ATTRS_o_ai vec_vupkhsw(vector
int __a) {
12692 #ifdef __LITTLE_ENDIAN__
12693 return __builtin_altivec_vupklsw(
__a);
12695 return __builtin_altivec_vupkhsw(
__a);
12700 vec_vupkhsw(vector
bool int __a) {
12701 #ifdef __LITTLE_ENDIAN__
12702 return (vector
bool long long)__builtin_altivec_vupklsw((vector
int)
__a);
12704 return (vector
bool long long)__builtin_altivec_vupkhsw((vector
int)
__a);
12713 #ifdef __LITTLE_ENDIAN__
12714 return __builtin_altivec_vupkhsb((vector
char)
__a);
12716 return __builtin_altivec_vupklsb((vector
char)
__a);
12722 #ifdef __LITTLE_ENDIAN__
12723 return (vector
bool short)__builtin_altivec_vupkhsb((vector
char)
__a);
12725 return (vector
bool short)__builtin_altivec_vupklsb((vector
char)
__a);
12730 #ifdef __LITTLE_ENDIAN__
12731 return __builtin_altivec_vupkhsh(
__a);
12733 return __builtin_altivec_vupklsh(
__a);
12739 #ifdef __LITTLE_ENDIAN__
12740 return (vector
bool int)__builtin_altivec_vupkhsh((vector
short)
__a);
12742 return (vector
bool int)__builtin_altivec_vupklsh((vector
short)
__a);
12748 #ifdef __LITTLE_ENDIAN__
12749 return (vector
unsigned int)__builtin_altivec_vupkhpx((vector
short)
__a);
12751 return (vector
unsigned int)__builtin_altivec_vupklpx((vector
short)
__a);
12755 #ifdef __POWER8_VECTOR__
12757 #ifdef __LITTLE_ENDIAN__
12758 return __builtin_altivec_vupkhsw(
__a);
12760 return __builtin_altivec_vupklsw(
__a);
12766 #ifdef __LITTLE_ENDIAN__
12767 return (vector
bool long long)__builtin_altivec_vupkhsw((vector
int)
__a);
12769 return (vector
bool long long)__builtin_altivec_vupklsw((vector
int)
__a);
12775 return (vector
double)(
__a[2],
__a[3]);
12783 #ifdef __LITTLE_ENDIAN__
12784 return __builtin_altivec_vupkhsb((vector
char)
__a);
12786 return __builtin_altivec_vupklsb((vector
char)
__a);
12792 #ifdef __LITTLE_ENDIAN__
12793 return (vector
bool short)__builtin_altivec_vupkhsb((vector
char)
__a);
12795 return (vector
bool short)__builtin_altivec_vupklsb((vector
char)
__a);
12802 #ifdef __LITTLE_ENDIAN__
12803 return __builtin_altivec_vupkhsh(
__a);
12805 return __builtin_altivec_vupklsh(
__a);
12811 #ifdef __LITTLE_ENDIAN__
12812 return (vector
bool int)__builtin_altivec_vupkhsh((vector
short)
__a);
12814 return (vector
bool int)__builtin_altivec_vupklsh((vector
short)
__a);
12820 #ifdef __LITTLE_ENDIAN__
12821 return (vector
unsigned int)__builtin_altivec_vupkhpx((vector
short)
__a);
12823 return (vector
unsigned int)__builtin_altivec_vupklpx((vector
short)
__a);
12829 #ifdef __POWER8_VECTOR__
12830 static __inline__ vector
long long __ATTRS_o_ai vec_vupklsw(vector
int __a) {
12831 #ifdef __LITTLE_ENDIAN__
12832 return __builtin_altivec_vupkhsw(
__a);
12834 return __builtin_altivec_vupklsw(
__a);
12839 vec_vupklsw(vector
bool int __a) {
12840 #ifdef __LITTLE_ENDIAN__
12841 return (vector
bool long long)__builtin_altivec_vupkhsw((vector
int)
__a);
12843 return (vector
bool long long)__builtin_altivec_vupklsw((vector
int)
__a);
12853 vec_vsx_ld(
int __a,
const vector
bool int *
__b) {
12854 return (vector
bool int)__builtin_vsx_lxvw4x(
__a,
__b);
12858 vec_vsx_ld(
int __a,
const vector
signed int *
__b) {
12859 return (vector
signed int)__builtin_vsx_lxvw4x(
__a,
__b);
12863 vec_vsx_ld(
int __a,
const signed int *
__b) {
12864 return (vector
signed int)__builtin_vsx_lxvw4x(
__a,
__b);
12868 vec_vsx_ld(
int __a,
const vector
unsigned int *
__b) {
12869 return (vector
unsigned int)__builtin_vsx_lxvw4x(
__a,
__b);
12873 vec_vsx_ld(
int __a,
const unsigned int *
__b) {
12874 return (vector
unsigned int)__builtin_vsx_lxvw4x(
__a,
__b);
12878 vec_vsx_ld(
int __a,
const vector
float *
__b) {
12879 return (vector
float)__builtin_vsx_lxvw4x(
__a,
__b);
12883 const float *
__b) {
12884 return (vector
float)__builtin_vsx_lxvw4x(
__a,
__b);
12887 static __inline__ vector
signed long long __ATTRS_o_ai
12888 vec_vsx_ld(
int __a,
const vector
signed long long *
__b) {
12889 return (vector
signed long long)__builtin_vsx_lxvd2x(
__a,
__b);
12892 static __inline__ vector
unsigned long long __ATTRS_o_ai
12893 vec_vsx_ld(
int __a,
const vector
unsigned long long *
__b) {
12894 return (vector
unsigned long long)__builtin_vsx_lxvd2x(
__a,
__b);
12898 vec_vsx_ld(
int __a,
const vector
double *
__b) {
12899 return (vector
double)__builtin_vsx_lxvd2x(
__a,
__b);
12903 vec_vsx_ld(
int __a,
const double *
__b) {
12904 return (vector
double)__builtin_vsx_lxvd2x(
__a,
__b);
12908 vec_vsx_ld(
int __a,
const vector
bool short *
__b) {
12909 return (vector
bool short)__builtin_vsx_lxvw4x(
__a,
__b);
12913 vec_vsx_ld(
int __a,
const vector
signed short *
__b) {
12914 return (vector
signed short)__builtin_vsx_lxvw4x(
__a,
__b);
12918 vec_vsx_ld(
int __a,
const signed short *
__b) {
12919 return (vector
signed short)__builtin_vsx_lxvw4x(
__a,
__b);
12923 vec_vsx_ld(
int __a,
const vector
unsigned short *
__b) {
12924 return (vector
unsigned short)__builtin_vsx_lxvw4x(
__a,
__b);
12928 vec_vsx_ld(
int __a,
const unsigned short *
__b) {
12929 return (vector
unsigned short)__builtin_vsx_lxvw4x(
__a,
__b);
12933 vec_vsx_ld(
int __a,
const vector
bool char *
__b) {
12934 return (vector
bool char)__builtin_vsx_lxvw4x(
__a,
__b);
12938 vec_vsx_ld(
int __a,
const vector
signed char *
__b) {
12939 return (vector
signed char)__builtin_vsx_lxvw4x(
__a,
__b);
12943 vec_vsx_ld(
int __a,
const signed char *
__b) {
12944 return (vector
signed char)__builtin_vsx_lxvw4x(
__a,
__b);
12948 vec_vsx_ld(
int __a,
const vector
unsigned char *
__b) {
12949 return (vector
unsigned char)__builtin_vsx_lxvw4x(
__a,
__b);
12953 vec_vsx_ld(
int __a,
const unsigned char *
__b) {
12954 return (vector
unsigned char)__builtin_vsx_lxvw4x(
__a,
__b);
12964 vector
bool int *
__c) {
12965 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
12970 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
12974 unsigned int *
__c) {
12975 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
12979 vector
signed int *
__c) {
12980 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
12985 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
12989 vector
unsigned int *
__c) {
12990 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
12994 unsigned int *
__c) {
12995 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
12999 vector
float *
__c) {
13000 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13005 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13008 static __inline__
void __ATTRS_o_ai vec_vsx_st(vector
signed long long __a,
13010 vector
signed long long *
__c) {
13011 __builtin_vsx_stxvd2x((vector
double)
__a,
__b,
__c);
13014 static __inline__
void __ATTRS_o_ai vec_vsx_st(vector
unsigned long long __a,
13016 vector
unsigned long long *
__c) {
13017 __builtin_vsx_stxvd2x((vector
double)
__a,
__b,
__c);
13021 vector
double *
__c) {
13022 __builtin_vsx_stxvd2x((vector
double)
__a,
__b,
__c);
13027 __builtin_vsx_stxvd2x((vector
double)
__a,
__b,
__c);
13031 vector
bool short *
__c) {
13032 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13036 signed short *
__c) {
13037 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13041 unsigned short *
__c) {
13042 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13045 vector
signed short *
__c) {
13046 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13050 signed short *
__c) {
13051 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13054 static __inline__
void __ATTRS_o_ai vec_vsx_st(vector
unsigned short __a,
13056 vector
unsigned short *
__c) {
13057 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13060 static __inline__
void __ATTRS_o_ai vec_vsx_st(vector
unsigned short __a,
13061 int __b,
unsigned short *
__c) {
13062 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13066 vector
bool char *
__c) {
13067 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13071 signed char *
__c) {
13072 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13076 unsigned char *
__c) {
13077 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13081 vector
signed char *
__c) {
13082 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13086 signed char *
__c) {
13087 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13090 static __inline__
void __ATTRS_o_ai vec_vsx_st(vector
unsigned char __a,
13092 vector
unsigned char *
__c) {
13093 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13096 static __inline__
void __ATTRS_o_ai vec_vsx_st(vector
unsigned char __a,
13097 int __b,
unsigned char *
__c) {
13098 __builtin_vsx_stxvw4x((vector
int)
__a,
__b,
__c);
13104 #define vec_xxpermdi __builtin_vsx_xxpermdi
13105 #define vec_xxsldwi __builtin_vsx_xxsldwi
13106 #define vec_permi(__a, __b, __c) \
13107 _Generic((__a), vector signed long long \
13108 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13109 (((__c)&0x1) + 2)), \
13110 vector unsigned long long \
13111 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13112 (((__c)&0x1) + 2)), \
13114 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13115 (((__c)&0x1) + 2)))
13120 #define __builtin_altivec_vxor vec_xor
13129 return (vector
signed char)
__a ^
__b;
13134 return __a ^ (vector
signed char)
__b;
13144 return (vector
unsigned char)
__a ^
__b;
13149 return __a ^ (vector
unsigned char)
__b;
13153 vector
bool char __b) {
13158 vector
short __b) {
13163 vector
short __b) {
13164 return (vector
short)
__a ^
__b;
13168 vector
bool short __b) {
13169 return __a ^ (vector short)
__b;
13179 return (vector
unsigned short)
__a ^
__b;
13184 return __a ^ (vector
unsigned short)
__b;
13199 return (vector
int)
__a ^
__b;
13203 vector
bool int __b) {
13214 return (vector
unsigned int)
__a ^
__b;
13223 vector
bool int __b) {
13228 vector
float __b) {
13229 vector
unsigned int __res =
13230 (vector
unsigned int)
__a ^ (vector
unsigned int)
__b;
13231 return (vector
float)__res;
13235 vector
float __b) {
13236 vector
unsigned int __res =
13237 (vector
unsigned int)
__a ^ (vector
unsigned int)
__b;
13238 return (vector
float)__res;
13242 vector
bool int __b) {
13243 vector
unsigned int __res =
13244 (vector
unsigned int)
__a ^ (vector
unsigned int)
__b;
13245 return (vector
float)__res;
13249 static __inline__ vector
signed long long __ATTRS_o_ai
13250 vec_xor(vector
signed long long __a, vector
signed long long __b) {
13254 static __inline__ vector
signed long long __ATTRS_o_ai
13255 vec_xor(vector
bool long long __a, vector
signed long long __b) {
13256 return (vector
signed long long)
__a ^
__b;
13259 static __inline__ vector
signed long long __ATTRS_o_ai
13260 vec_xor(vector
signed long long __a, vector
bool long long __b) {
13261 return __a ^ (vector
signed long long)
__b;
13264 static __inline__ vector
unsigned long long __ATTRS_o_ai
13265 vec_xor(vector
unsigned long long __a, vector
unsigned long long __b) {
13269 static __inline__ vector
unsigned long long __ATTRS_o_ai
13270 vec_xor(vector
bool long long __a, vector
unsigned long long __b) {
13271 return (vector
unsigned long long)
__a ^
__b;
13274 static __inline__ vector
unsigned long long __ATTRS_o_ai
13275 vec_xor(vector
unsigned long long __a, vector
bool long long __b) {
13276 return __a ^ (vector
unsigned long long)
__b;
13280 vec_xor(vector
bool long long __a, vector
bool long long __b) {
13285 vector
double __b) {
13286 return (vector
double)((vector
unsigned long long)
__a ^
13287 (vector
unsigned long long)
__b);
13292 return (vector
double)((vector
unsigned long long)
__a ^
13293 (vector
unsigned long long)
__b);
13297 vector
double __b) {
13298 return (vector
double)((vector
unsigned long long)
__a ^
13299 (vector
unsigned long long)
__b);
13312 return (vector
signed char)
__a ^
__b;
13317 return __a ^ (vector
signed char)
__b;
13327 return (vector
unsigned char)
__a ^
__b;
13332 return __a ^ (vector
unsigned char)
__b;
13336 vector
bool char __b) {
13341 vector
short __b) {
13346 vector
short __b) {
13347 return (vector
short)
__a ^
__b;
13351 vector
bool short __b) {
13352 return __a ^ (vector short)
__b;
13362 return (vector
unsigned short)
__a ^
__b;
13367 return __a ^ (vector
unsigned short)
__b;
13382 return (vector
int)
__a ^
__b;
13386 vector
bool int __b) {
13397 return (vector
unsigned int)
__a ^
__b;
13406 vector
bool int __b) {
13411 vector
float __b) {
13412 vector
unsigned int __res =
13413 (vector
unsigned int)
__a ^ (vector
unsigned int)
__b;
13414 return (vector
float)__res;
13418 vector
float __b) {
13419 vector
unsigned int __res =
13420 (vector
unsigned int)
__a ^ (vector
unsigned int)
__b;
13421 return (vector
float)__res;
13425 vector
bool int __b) {
13426 vector
unsigned int __res =
13427 (vector
unsigned int)
__a ^ (vector
unsigned int)
__b;
13428 return (vector
float)__res;
13432 static __inline__ vector
signed long long __ATTRS_o_ai
13433 vec_vxor(vector
signed long long __a, vector
signed long long __b) {
13437 static __inline__ vector
signed long long __ATTRS_o_ai
13438 vec_vxor(vector
bool long long __a, vector
signed long long __b) {
13439 return (vector
signed long long)
__a ^
__b;
13442 static __inline__ vector
signed long long __ATTRS_o_ai
13443 vec_vxor(vector
signed long long __a, vector
bool long long __b) {
13444 return __a ^ (vector
signed long long)
__b;
13447 static __inline__ vector
unsigned long long __ATTRS_o_ai
13448 vec_vxor(vector
unsigned long long __a, vector
unsigned long long __b) {
13452 static __inline__ vector
unsigned long long __ATTRS_o_ai
13453 vec_vxor(vector
bool long long __a, vector
unsigned long long __b) {
13454 return (vector
unsigned long long)
__a ^
__b;
13457 static __inline__ vector
unsigned long long __ATTRS_o_ai
13458 vec_vxor(vector
unsigned long long __a, vector
bool long long __b) {
13459 return __a ^ (vector
unsigned long long)
__b;
13463 vec_vxor(vector
bool long long __a, vector
bool long long __b) {
13544 #ifdef __POWER9_VECTOR__
13546 #define vec_insert4b __builtin_vsx_insertword
13547 #define vec_extract4b __builtin_vsx_extractuword
13552 vec_extract_exp(vector
float __a) {
13553 return __builtin_vsx_xvxexpsp(
__a);
13556 static __inline__ vector
unsigned long long __ATTRS_o_ai
13557 vec_extract_exp(vector
double __a) {
13558 return __builtin_vsx_xvxexpdp(
__a);
13564 vec_extract_sig(vector
float __a) {
13565 return __builtin_vsx_xvxsigsp(
__a);
13568 static __inline__ vector
unsigned long long __ATTRS_o_ai
13569 vec_extract_sig (vector
double __a) {
13570 return __builtin_vsx_xvxsigdp(
__a);
13574 vec_extract_fp32_from_shorth(vector
unsigned short __a) {
13575 vector
unsigned short __b =
13576 #ifdef __LITTLE_ENDIAN__
13577 __builtin_shufflevector(
__a,
__a, 0, -1, 1, -1, 2, -1, 3, -1);
13579 __builtin_shufflevector(
__a,
__a, -1, 0, -1, 1, -1, 2, -1, 3);
13581 return __builtin_vsx_xvcvhpsp(
__b);
13585 vec_extract_fp32_from_shortl(vector
unsigned short __a) {
13586 vector
unsigned short __b =
13587 #ifdef __LITTLE_ENDIAN__
13588 __builtin_shufflevector(
__a,
__a, 4, -1, 5, -1, 6, -1, 7, -1);
13590 __builtin_shufflevector(
__a,
__a, -1, 4, -1, 5, -1, 6, -1, 7);
13592 return __builtin_vsx_xvcvhpsp(
__b);
13611 vector
bool char __b,
13648 vector
bool int __b,
13655 static __inline__ vector
signed long long __ATTRS_o_ai
13661 static __inline__ vector
unsigned long long __ATTRS_o_ai
13720 const short *
__b) {
13725 const vector
short *
__b) {
13749 const vector pixel *
__b) {
13759 const vector
int *
__b) {
13783 const float *
__b) {
13788 const vector
float *
__b) {
13826 const short *
__b) {
13831 const vector
short *
__b) {
13855 const vector pixel *
__b) {
13865 const vector
int *
__b) {
13889 const float *
__b) {
13894 vector
float *
__b) {
13932 const short *
__b) {
13937 const vector
short *
__b) {
13961 const vector pixel *
__b) {
13971 const vector
int *
__b) {
13995 const float *
__b) {
14000 const vector
float *
__b) {
14038 const short *
__b) {
14043 const vector
short *
__b) {
14067 const vector pixel *
__b) {
14077 const vector
int *
__b) {
14101 const float *
__b) {
14106 const vector
float *
__b) {
14114 signed char *
__c) {
14120 vector
signed char *
__c) {
14127 unsigned char *
__c) {
14133 vector
unsigned char *
__c) {
14140 vector
bool char *
__c) {
14153 vector
short *
__c) {
14160 int __b,
unsigned short *
__c) {
14167 vector
unsigned short *
__c) {
14174 vector
bool short *
__c) {
14181 vector pixel *
__c) {
14201 unsigned int *
__c) {
14207 vector
unsigned int *
__c) {
14214 vector
bool int *
__c) {
14221 vector
float *
__c) {
14230 signed char *
__c) {
14236 vector
signed char *
__c) {
14243 int __b,
unsigned char *
__c) {
14250 vector
unsigned char *
__c) {
14257 vector
bool char *
__c) {
14270 vector
short *
__c) {
14277 int __b,
unsigned short *
__c) {
14284 vector
unsigned short *
__c) {
14291 vector
bool short *
__c) {
14298 vector pixel *
__c) {
14318 unsigned int *
__c) {
14324 vector
unsigned int *
__c) {
14331 vector
bool int *
__c) {
14338 vector
float *
__c) {
14347 signed char *
__c) {
14353 vector
signed char *
__c) {
14360 unsigned char *
__c) {
14366 vector
unsigned char *
__c) {
14373 vector
bool char *
__c) {
14386 vector
short *
__c) {
14393 int __b,
unsigned short *
__c) {
14400 vector
unsigned short *
__c) {
14407 vector
bool short *
__c) {
14414 vector pixel *
__c) {
14434 unsigned int *
__c) {
14440 vector
unsigned int *
__c) {
14447 vector
bool int *
__c) {
14454 vector
float *
__c) {
14463 signed char *
__c) {
14469 vector
signed char *
__c) {
14476 int __b,
unsigned char *
__c) {
14483 vector
unsigned char *
__c) {
14490 vector
bool char *
__c) {
14503 vector
short *
__c) {
14510 int __b,
unsigned short *
__c) {
14517 vector
unsigned short *
__c) {
14524 vector
bool short *
__c) {
14531 vector pixel *
__c) {
14551 unsigned int *
__c) {
14557 vector
unsigned int *
__c) {
14564 vector
bool int *
__c) {
14571 vector
float *
__c) {
14581 vector
signed char __res = (vector
signed char)(0);
14588 vector
unsigned char __res = (vector
unsigned char)(0);
14594 vector
short __res = (vector short)(0);
14601 vector
unsigned short __res = (vector
unsigned short)(0);
14607 vector
int __res = (vector
int)(0);
14614 vector
unsigned int __res = (vector
unsigned int)(0);
14620 vector
float __res = (vector
float)(0);
14627 vector
double __res = (vector
double)(0);
14632 static __inline__ vector
signed long long __ATTRS_o_ai
14634 vector
signed long long __res = (vector
signed long long)(0);
14639 static __inline__ vector
unsigned long long __ATTRS_o_ai
14641 vector
unsigned long long __res = (vector
unsigned long long)(0);
14650 return (vector
signed char)(
__a);
14655 return (vector
unsigned char)(
__a);
14659 return (vector
short)(
__a);
14664 return (vector
unsigned short)(
__a);
14668 return (vector
int)(
__a);
14673 return (vector
unsigned int)(
__a);
14677 static __inline__ vector
signed long long __ATTRS_o_ai
14679 return (vector
signed long long)(
__a);
14682 static __inline__ vector
unsigned long long __ATTRS_o_ai
14684 return (vector
unsigned long long)(
__a);
14687 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
14688 defined(__SIZEOF_INT128__)
14691 return (vector
signed __int128)(
__a);
14694 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
14696 return (vector
unsigned __int128)(
__a);
14702 return (vector
double)(
__a);
14707 return (vector
float)(
__a);
14715 vector
signed char __b) {
14716 return __builtin_altivec_vcmpequb_p(
__CR6_LT, (vector
char)
__a,
14721 vector
bool char __b) {
14722 return __builtin_altivec_vcmpequb_p(
__CR6_LT, (vector
char)
__a,
14727 vector
unsigned char __b) {
14728 return __builtin_altivec_vcmpequb_p(
__CR6_LT, (vector
char)
__a,
14733 vector
bool char __b) {
14734 return __builtin_altivec_vcmpequb_p(
__CR6_LT, (vector
char)
__a,
14739 vector
signed char __b) {
14740 return __builtin_altivec_vcmpequb_p(
__CR6_LT, (vector
char)
__a,
14745 vector
unsigned char __b) {
14746 return __builtin_altivec_vcmpequb_p(
__CR6_LT, (vector
char)
__a,
14751 vector
bool char __b) {
14752 return __builtin_altivec_vcmpequb_p(
__CR6_LT, (vector
char)
__a,
14757 vector
short __b) {
14762 vector
bool short __b) {
14763 return __builtin_altivec_vcmpequh_p(
__CR6_LT,
__a, (vector
short)
__b);
14767 vector
unsigned short __b) {
14768 return __builtin_altivec_vcmpequh_p(
__CR6_LT, (vector
short)
__a,
14769 (vector
short)
__b);
14773 vector
bool short __b) {
14774 return __builtin_altivec_vcmpequh_p(
__CR6_LT, (vector
short)
__a,
14775 (vector
short)
__b);
14779 vector
short __b) {
14780 return __builtin_altivec_vcmpequh_p(
__CR6_LT, (vector
short)
__a,
14781 (vector
short)
__b);
14785 vector
unsigned short __b) {
14786 return __builtin_altivec_vcmpequh_p(
__CR6_LT, (vector
short)
__a,
14787 (vector
short)
__b);
14791 vector
bool short __b) {
14792 return __builtin_altivec_vcmpequh_p(
__CR6_LT, (vector
short)
__a,
14793 (vector
short)
__b);
14797 vector pixel
__b) {
14798 return __builtin_altivec_vcmpequh_p(
__CR6_LT, (vector
short)
__a,
14799 (vector
short)
__b);
14807 vector
bool int __b) {
14808 return __builtin_altivec_vcmpequw_p(
__CR6_LT,
__a, (vector
int)
__b);
14812 vector
unsigned int __b) {
14813 return __builtin_altivec_vcmpequw_p(
__CR6_LT, (vector
int)
__a,
14818 vector
bool int __b) {
14819 return __builtin_altivec_vcmpequw_p(
__CR6_LT, (vector
int)
__a,
14825 return __builtin_altivec_vcmpequw_p(
__CR6_LT, (vector
int)
__a,
14830 vector
unsigned int __b) {
14831 return __builtin_altivec_vcmpequw_p(
__CR6_LT, (vector
int)
__a,
14836 vector
bool int __b) {
14837 return __builtin_altivec_vcmpequw_p(
__CR6_LT, (vector
int)
__a,
14843 vector
signed long long __b) {
14844 #ifdef __POWER8_VECTOR__
14854 vector
bool long long __b) {
14855 return vec_all_eq((vector
signed long long)
__a, (vector
signed long long)
__b);
14859 vector
unsigned long long __b) {
14860 return vec_all_eq((vector
signed long long)
__a, (vector
signed long long)
__b);
14864 vector
bool long long __b) {
14865 return vec_all_eq((vector
signed long long)
__a, (vector
signed long long)
__b);
14869 vector
long long __b) {
14870 return vec_all_eq((vector
signed long long)
__a, (vector
signed long long)
__b);
14874 vector
unsigned long long __b) {
14875 return vec_all_eq((vector
signed long long)
__a, (vector
signed long long)
__b);
14879 vector
bool long long __b) {
14880 return vec_all_eq((vector
signed long long)
__a, (vector
signed long long)
__b);
14885 vector
float __b) {
14895 vector
double __b) {
14900 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
14902 vector
signed __int128
__b) {
14907 vector
unsigned __int128
__b) {
14912 vector
bool __int128
__b) {
14920 vector
signed char __b) {
14925 vector
bool char __b) {
14926 return __builtin_altivec_vcmpgtsb_p(
__CR6_EQ, (vector
signed char)
__b,
__a);
14930 vector
unsigned char __b) {
14935 vector
bool char __b) {
14936 return __builtin_altivec_vcmpgtub_p(
__CR6_EQ, (vector
unsigned char)
__b,
__a);
14940 vector
signed char __b) {
14941 return __builtin_altivec_vcmpgtsb_p(
__CR6_EQ,
__b, (vector
signed char)
__a);
14945 vector
unsigned char __b) {
14946 return __builtin_altivec_vcmpgtub_p(
__CR6_EQ,
__b, (vector
unsigned char)
__a);
14950 vector
bool char __b) {
14951 return __builtin_altivec_vcmpgtub_p(
__CR6_EQ, (vector
unsigned char)
__b,
14952 (vector
unsigned char)
__a);
14956 vector
short __b) {
14961 vector
bool short __b) {
14962 return __builtin_altivec_vcmpgtsh_p(
__CR6_EQ, (vector
short)
__b,
__a);
14966 vector
unsigned short __b) {
14971 vector
bool short __b) {
14972 return __builtin_altivec_vcmpgtuh_p(
__CR6_EQ, (vector
unsigned short)
__b,
14977 vector
short __b) {
14978 return __builtin_altivec_vcmpgtsh_p(
__CR6_EQ,
__b, (vector
signed short)
__a);
14982 vector
unsigned short __b) {
14983 return __builtin_altivec_vcmpgtuh_p(
__CR6_EQ,
__b,
14984 (vector
unsigned short)
__a);
14988 vector
bool short __b) {
14989 return __builtin_altivec_vcmpgtuh_p(
__CR6_EQ, (vector
unsigned short)
__b,
14990 (vector
unsigned short)
__a);
14998 vector
bool int __b) {
14999 return __builtin_altivec_vcmpgtsw_p(
__CR6_EQ, (vector
int)
__b,
__a);
15003 vector
unsigned int __b) {
15008 vector
bool int __b) {
15009 return __builtin_altivec_vcmpgtuw_p(
__CR6_EQ, (vector
unsigned int)
__b,
__a);
15014 return __builtin_altivec_vcmpgtsw_p(
__CR6_EQ,
__b, (vector
signed int)
__a);
15018 vector
unsigned int __b) {
15019 return __builtin_altivec_vcmpgtuw_p(
__CR6_EQ,
__b, (vector
unsigned int)
__a);
15023 vector
bool int __b) {
15024 return __builtin_altivec_vcmpgtuw_p(
__CR6_EQ, (vector
unsigned int)
__b,
15025 (vector
unsigned int)
__a);
15030 vector
signed long long __b) {
15034 vector
bool long long __b) {
15035 return __builtin_altivec_vcmpgtsd_p(
__CR6_EQ, (vector
signed long long)
__b,
15040 vector
unsigned long long __b) {
15045 vector
bool long long __b) {
15046 return __builtin_altivec_vcmpgtud_p(
__CR6_EQ, (vector
unsigned long long)
__b,
15051 vector
signed long long __b) {
15052 return __builtin_altivec_vcmpgtsd_p(
__CR6_EQ,
__b,
15053 (vector
signed long long)
__a);
15057 vector
unsigned long long __b) {
15058 return __builtin_altivec_vcmpgtud_p(
__CR6_EQ,
__b,
15059 (vector
unsigned long long)
__a);
15063 vector
bool long long __b) {
15064 return __builtin_altivec_vcmpgtud_p(
__CR6_EQ, (vector
unsigned long long)
__b,
15065 (vector
unsigned long long)
__a);
15070 vector
float __b) {
15080 vector
double __b) {
15085 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15087 vector
signed __int128
__b) {
15092 vector
unsigned __int128
__b) {
15100 vector
signed char __b) {
15105 vector
bool char __b) {
15106 return __builtin_altivec_vcmpgtsb_p(
__CR6_LT,
__a, (vector
signed char)
__b);
15110 vector
unsigned char __b) {
15115 vector
bool char __b) {
15116 return __builtin_altivec_vcmpgtub_p(
__CR6_LT,
__a, (vector
unsigned char)
__b);
15120 vector
signed char __b) {
15121 return __builtin_altivec_vcmpgtsb_p(
__CR6_LT, (vector
signed char)
__a,
__b);
15125 vector
unsigned char __b) {
15126 return __builtin_altivec_vcmpgtub_p(
__CR6_LT, (vector
unsigned char)
__a,
__b);
15130 vector
bool char __b) {
15131 return __builtin_altivec_vcmpgtub_p(
__CR6_LT, (vector
unsigned char)
__a,
15132 (vector
unsigned char)
__b);
15136 vector
short __b) {
15141 vector
bool short __b) {
15142 return __builtin_altivec_vcmpgtsh_p(
__CR6_LT,
__a, (vector
short)
__b);
15146 vector
unsigned short __b) {
15151 vector
bool short __b) {
15152 return __builtin_altivec_vcmpgtuh_p(
__CR6_LT,
__a,
15153 (vector
unsigned short)
__b);
15157 vector
short __b) {
15158 return __builtin_altivec_vcmpgtsh_p(
__CR6_LT, (vector
signed short)
__a,
__b);
15162 vector
unsigned short __b) {
15163 return __builtin_altivec_vcmpgtuh_p(
__CR6_LT, (vector
unsigned short)
__a,
15168 vector
bool short __b) {
15169 return __builtin_altivec_vcmpgtuh_p(
__CR6_LT, (vector
unsigned short)
__a,
15170 (vector
unsigned short)
__b);
15178 vector
bool int __b) {
15179 return __builtin_altivec_vcmpgtsw_p(
__CR6_LT,
__a, (vector
int)
__b);
15183 vector
unsigned int __b) {
15188 vector
bool int __b) {
15189 return __builtin_altivec_vcmpgtuw_p(
__CR6_LT,
__a, (vector
unsigned int)
__b);
15194 return __builtin_altivec_vcmpgtsw_p(
__CR6_LT, (vector
signed int)
__a,
__b);
15198 vector
unsigned int __b) {
15199 return __builtin_altivec_vcmpgtuw_p(
__CR6_LT, (vector
unsigned int)
__a,
__b);
15203 vector
bool int __b) {
15204 return __builtin_altivec_vcmpgtuw_p(
__CR6_LT, (vector
unsigned int)
__a,
15205 (vector
unsigned int)
__b);
15210 vector
signed long long __b) {
15214 vector
bool long long __b) {
15215 return __builtin_altivec_vcmpgtsd_p(
__CR6_LT,
__a,
15216 (vector
signed long long)
__b);
15220 vector
unsigned long long __b) {
15225 vector
bool long long __b) {
15226 return __builtin_altivec_vcmpgtud_p(
__CR6_LT,
__a,
15227 (vector
unsigned long long)
__b);
15231 vector
signed long long __b) {
15232 return __builtin_altivec_vcmpgtsd_p(
__CR6_LT, (vector
signed long long)
__a,
15237 vector
unsigned long long __b) {
15238 return __builtin_altivec_vcmpgtud_p(
__CR6_LT, (vector
unsigned long long)
__a,
15243 vector
bool long long __b) {
15244 return __builtin_altivec_vcmpgtud_p(
__CR6_LT, (vector
unsigned long long)
__a,
15245 (vector
unsigned long long)
__b);
15250 vector
float __b) {
15260 vector
double __b) {
15265 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15267 vector
signed __int128
__b) {
15272 vector
unsigned __int128
__b) {
15280 vec_all_in(vector
float __a, vector
float __b) {
15287 vector
signed char __b) {
15292 vector
bool char __b) {
15293 return __builtin_altivec_vcmpgtsb_p(
__CR6_EQ,
__a, (vector
signed char)
__b);
15297 vector
unsigned char __b) {
15302 vector
bool char __b) {
15303 return __builtin_altivec_vcmpgtub_p(
__CR6_EQ,
__a, (vector
unsigned char)
__b);
15307 vector
signed char __b) {
15308 return __builtin_altivec_vcmpgtsb_p(
__CR6_EQ, (vector
signed char)
__a,
__b);
15312 vector
unsigned char __b) {
15313 return __builtin_altivec_vcmpgtub_p(
__CR6_EQ, (vector
unsigned char)
__a,
__b);
15317 vector
bool char __b) {
15318 return __builtin_altivec_vcmpgtub_p(
__CR6_EQ, (vector
unsigned char)
__a,
15319 (vector
unsigned char)
__b);
15323 vector
short __b) {
15328 vector
bool short __b) {
15329 return __builtin_altivec_vcmpgtsh_p(
__CR6_EQ,
__a, (vector
short)
__b);
15333 vector
unsigned short __b) {
15338 vector
bool short __b) {
15339 return __builtin_altivec_vcmpgtuh_p(
__CR6_EQ,
__a,
15340 (vector
unsigned short)
__b);
15344 vector
short __b) {
15345 return __builtin_altivec_vcmpgtsh_p(
__CR6_EQ, (vector
signed short)
__a,
__b);
15349 vector
unsigned short __b) {
15350 return __builtin_altivec_vcmpgtuh_p(
__CR6_EQ, (vector
unsigned short)
__a,
15355 vector
bool short __b) {
15356 return __builtin_altivec_vcmpgtuh_p(
__CR6_EQ, (vector
unsigned short)
__a,
15357 (vector
unsigned short)
__b);
15365 vector
bool int __b) {
15366 return __builtin_altivec_vcmpgtsw_p(
__CR6_EQ,
__a, (vector
int)
__b);
15370 vector
unsigned int __b) {
15375 vector
bool int __b) {
15376 return __builtin_altivec_vcmpgtuw_p(
__CR6_EQ,
__a, (vector
unsigned int)
__b);
15381 return __builtin_altivec_vcmpgtsw_p(
__CR6_EQ, (vector
signed int)
__a,
__b);
15385 vector
unsigned int __b) {
15386 return __builtin_altivec_vcmpgtuw_p(
__CR6_EQ, (vector
unsigned int)
__a,
__b);
15390 vector
bool int __b) {
15391 return __builtin_altivec_vcmpgtuw_p(
__CR6_EQ, (vector
unsigned int)
__a,
15392 (vector
unsigned int)
__b);
15397 vector
signed long long __b) {
15402 vector
unsigned long long __b) {
15407 vector
bool long long __b) {
15408 return __builtin_altivec_vcmpgtsd_p(
__CR6_EQ,
__a,
15409 (vector
signed long long)
__b);
15413 vector
bool long long __b) {
15414 return __builtin_altivec_vcmpgtud_p(
__CR6_EQ,
__a,
15415 (vector
unsigned long long)
__b);
15419 vector
signed long long __b) {
15420 return __builtin_altivec_vcmpgtsd_p(
__CR6_EQ, (vector
signed long long)
__a,
15425 vector
unsigned long long __b) {
15426 return __builtin_altivec_vcmpgtud_p(
__CR6_EQ, (vector
unsigned long long)
__a,
15431 vector
bool long long __b) {
15432 return __builtin_altivec_vcmpgtud_p(
__CR6_EQ, (vector
unsigned long long)
__a,
15433 (vector
unsigned long long)
__b);
15438 vector
float __b) {
15448 vector
double __b) {
15453 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15455 vector
signed __int128
__b) {
15460 vector
unsigned __int128
__b) {
15468 vector
signed char __b) {
15473 vector
bool char __b) {
15474 return __builtin_altivec_vcmpgtsb_p(
__CR6_LT, (vector
signed char)
__b,
__a);
15478 vector
unsigned char __b) {
15483 vector
bool char __b) {
15484 return __builtin_altivec_vcmpgtub_p(
__CR6_LT, (vector
unsigned char)
__b,
__a);
15488 vector
signed char __b) {
15489 return __builtin_altivec_vcmpgtsb_p(
__CR6_LT,
__b, (vector
signed char)
__a);
15493 vector
unsigned char __b) {
15494 return __builtin_altivec_vcmpgtub_p(
__CR6_LT,
__b, (vector
unsigned char)
__a);
15498 vector
bool char __b) {
15499 return __builtin_altivec_vcmpgtub_p(
__CR6_LT, (vector
unsigned char)
__b,
15500 (vector
unsigned char)
__a);
15504 vector
short __b) {
15509 vector
bool short __b) {
15510 return __builtin_altivec_vcmpgtsh_p(
__CR6_LT, (vector
short)
__b,
__a);
15514 vector
unsigned short __b) {
15519 vector
bool short __b) {
15520 return __builtin_altivec_vcmpgtuh_p(
__CR6_LT, (vector
unsigned short)
__b,
15525 vector
short __b) {
15526 return __builtin_altivec_vcmpgtsh_p(
__CR6_LT,
__b, (vector
signed short)
__a);
15530 vector
unsigned short __b) {
15531 return __builtin_altivec_vcmpgtuh_p(
__CR6_LT,
__b,
15532 (vector
unsigned short)
__a);
15536 vector
bool short __b) {
15537 return __builtin_altivec_vcmpgtuh_p(
__CR6_LT, (vector
unsigned short)
__b,
15538 (vector
unsigned short)
__a);
15546 vector
bool int __b) {
15547 return __builtin_altivec_vcmpgtsw_p(
__CR6_LT, (vector
int)
__b,
__a);
15551 vector
unsigned int __b) {
15556 vector
bool int __b) {
15557 return __builtin_altivec_vcmpgtuw_p(
__CR6_LT, (vector
unsigned int)
__b,
__a);
15562 return __builtin_altivec_vcmpgtsw_p(
__CR6_LT,
__b, (vector
signed int)
__a);
15566 vector
unsigned int __b) {
15567 return __builtin_altivec_vcmpgtuw_p(
__CR6_LT,
__b, (vector
unsigned int)
__a);
15571 vector
bool int __b) {
15572 return __builtin_altivec_vcmpgtuw_p(
__CR6_LT, (vector
unsigned int)
__b,
15573 (vector
unsigned int)
__a);
15578 vector
signed long long __b) {
15583 vector
unsigned long long __b) {
15588 vector
bool long long __b) {
15589 return __builtin_altivec_vcmpgtsd_p(
__CR6_LT, (vector
signed long long)
__b,
15594 vector
bool long long __b) {
15595 return __builtin_altivec_vcmpgtud_p(
__CR6_LT, (vector
unsigned long long)
__b,
15600 vector
signed long long __b) {
15601 return __builtin_altivec_vcmpgtsd_p(
__CR6_LT,
__b,
15602 (vector
signed long long)
__a);
15606 vector
unsigned long long __b) {
15607 return __builtin_altivec_vcmpgtud_p(
__CR6_LT,
__b,
15608 (vector
unsigned long long)
__a);
15612 vector
bool long long __b) {
15613 return __builtin_altivec_vcmpgtud_p(
__CR6_LT, (vector
unsigned long long)
__b,
15614 (vector
unsigned long long)
__a);
15619 vector
float __b) {
15629 vector
double __b) {
15634 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15636 vector
signed __int128
__b) {
15641 vector
unsigned __int128
__b) {
15665 vector
signed char __b) {
15666 return __builtin_altivec_vcmpequb_p(
__CR6_EQ, (vector
char)
__a,
15671 vector
bool char __b) {
15672 return __builtin_altivec_vcmpequb_p(
__CR6_EQ, (vector
char)
__a,
15677 vector
unsigned char __b) {
15678 return __builtin_altivec_vcmpequb_p(
__CR6_EQ, (vector
char)
__a,
15683 vector
bool char __b) {
15684 return __builtin_altivec_vcmpequb_p(
__CR6_EQ, (vector
char)
__a,
15689 vector
signed char __b) {
15690 return __builtin_altivec_vcmpequb_p(
__CR6_EQ, (vector
char)
__a,
15695 vector
unsigned char __b) {
15696 return __builtin_altivec_vcmpequb_p(
__CR6_EQ, (vector
char)
__a,
15701 vector
bool char __b) {
15702 return __builtin_altivec_vcmpequb_p(
__CR6_EQ, (vector
char)
__a,
15707 vector
short __b) {
15712 vector
bool short __b) {
15713 return __builtin_altivec_vcmpequh_p(
__CR6_EQ,
__a, (vector
short)
__b);
15717 vector
unsigned short __b) {
15718 return __builtin_altivec_vcmpequh_p(
__CR6_EQ, (vector
short)
__a,
15719 (vector
short)
__b);
15723 vector
bool short __b) {
15724 return __builtin_altivec_vcmpequh_p(
__CR6_EQ, (vector
short)
__a,
15725 (vector
short)
__b);
15729 vector
short __b) {
15730 return __builtin_altivec_vcmpequh_p(
__CR6_EQ, (vector
short)
__a,
15731 (vector
short)
__b);
15735 vector
unsigned short __b) {
15736 return __builtin_altivec_vcmpequh_p(
__CR6_EQ, (vector
short)
__a,
15737 (vector
short)
__b);
15741 vector
bool short __b) {
15742 return __builtin_altivec_vcmpequh_p(
__CR6_EQ, (vector
short)
__a,
15743 (vector
short)
__b);
15747 vector pixel
__b) {
15748 return __builtin_altivec_vcmpequh_p(
__CR6_EQ, (vector
short)
__a,
15749 (vector
short)
__b);
15757 vector
bool int __b) {
15758 return __builtin_altivec_vcmpequw_p(
__CR6_EQ,
__a, (vector
int)
__b);
15762 vector
unsigned int __b) {
15763 return __builtin_altivec_vcmpequw_p(
__CR6_EQ, (vector
int)
__a,
15768 vector
bool int __b) {
15769 return __builtin_altivec_vcmpequw_p(
__CR6_EQ, (vector
int)
__a,
15775 return __builtin_altivec_vcmpequw_p(
__CR6_EQ, (vector
int)
__a,
15780 vector
unsigned int __b) {
15781 return __builtin_altivec_vcmpequw_p(
__CR6_EQ, (vector
int)
__a,
15786 vector
bool int __b) {
15787 return __builtin_altivec_vcmpequw_p(
__CR6_EQ, (vector
int)
__a,
15793 vector
signed long long __b) {
15798 vector
unsigned long long __b) {
15799 return __builtin_altivec_vcmpequd_p(
__CR6_EQ, (vector
long long)
__a,
15800 (vector
long long)
__b);
15804 vector
bool long long __b) {
15805 return __builtin_altivec_vcmpequd_p(
__CR6_EQ,
__a,
15806 (vector
signed long long)
__b);
15810 vector
bool long long __b) {
15811 return __builtin_altivec_vcmpequd_p(
__CR6_EQ, (vector
signed long long)
__a,
15812 (vector
signed long long)
__b);
15816 vector
signed long long __b) {
15817 return __builtin_altivec_vcmpequd_p(
__CR6_EQ, (vector
signed long long)
__a,
15818 (vector
signed long long)
__b);
15822 vector
unsigned long long __b) {
15823 return __builtin_altivec_vcmpequd_p(
__CR6_EQ, (vector
signed long long)
__a,
15824 (vector
signed long long)
__b);
15828 vector
bool long long __b) {
15829 return __builtin_altivec_vcmpequd_p(
__CR6_EQ, (vector
signed long long)
__a,
15830 (vector
signed long long)
__b);
15835 vector
float __b) {
15845 vector
double __b) {
15850 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15852 vector
signed __int128
__b) {
15857 vector
unsigned __int128
__b) {
15862 vector
bool __int128
__b) {
15870 vector
float __b) {
15880 vector
double __b) {
15888 vector
float __b) {
15898 vector
double __b) {
15916 vector
double __b) {
15934 vector
double __b) {
15959 vector
signed char __b) {
15965 vector
bool char __b) {
15971 vector
unsigned char __b) {
15977 vector
bool char __b) {
15983 vector
signed char __b) {
15989 vector
unsigned char __b) {
15995 vector
bool char __b) {
16001 vector
short __b) {
16006 vector
bool short __b) {
16011 vector
unsigned short __b) {
16013 (vector
short)
__b);
16017 vector
bool short __b) {
16019 (vector
short)
__b);
16023 vector
short __b) {
16025 (vector
short)
__b);
16029 vector
unsigned short __b) {
16031 (vector
short)
__b);
16035 vector
bool short __b) {
16037 (vector
short)
__b);
16041 vector pixel
__b) {
16043 (vector
short)
__b);
16051 vector
bool int __b) {
16056 vector
unsigned int __b) {
16062 vector
bool int __b) {
16074 vector
unsigned int __b) {
16080 vector
bool int __b) {
16087 vector
signed long long __b) {
16092 vector
unsigned long long __b) {
16093 return __builtin_altivec_vcmpequd_p(
__CR6_EQ_REV, (vector
long long)
__a,
16094 (vector
long long)
__b);
16098 vector
bool long long __b) {
16100 (vector
signed long long)
__b);
16104 vector
bool long long __b) {
16105 return __builtin_altivec_vcmpequd_p(
16110 vector
signed long long __b) {
16111 return __builtin_altivec_vcmpequd_p(
16116 vector
unsigned long long __b) {
16117 return __builtin_altivec_vcmpequd_p(
16122 vector
bool long long __b) {
16123 return __builtin_altivec_vcmpequd_p(
16129 vector
float __b) {
16139 vector
double __b) {
16144 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16146 vector
signed __int128
__b) {
16151 vector
unsigned __int128
__b) {
16156 vector
bool __int128
__b) {
16164 vector
signed char __b) {
16169 vector
bool char __b) {
16170 return __builtin_altivec_vcmpgtsb_p(
__CR6_LT_REV, (vector
signed char)
__b,
16175 vector
unsigned char __b) {
16180 vector
bool char __b) {
16181 return __builtin_altivec_vcmpgtub_p(
__CR6_LT_REV, (vector
unsigned char)
__b,
16186 vector
signed char __b) {
16188 (vector
signed char)
__a);
16192 vector
unsigned char __b) {
16194 (vector
unsigned char)
__a);
16198 vector
bool char __b) {
16199 return __builtin_altivec_vcmpgtub_p(
__CR6_LT_REV, (vector
unsigned char)
__b,
16200 (vector
unsigned char)
__a);
16204 vector
short __b) {
16209 vector
bool short __b) {
16214 vector
unsigned short __b) {
16219 vector
bool short __b) {
16220 return __builtin_altivec_vcmpgtuh_p(
__CR6_LT_REV, (vector
unsigned short)
__b,
16225 vector
short __b) {
16227 (vector
signed short)
__a);
16231 vector
unsigned short __b) {
16233 (vector
unsigned short)
__a);
16237 vector
bool short __b) {
16238 return __builtin_altivec_vcmpgtuh_p(
__CR6_LT_REV, (vector
unsigned short)
__b,
16239 (vector
unsigned short)
__a);
16247 vector
bool int __b) {
16252 vector
unsigned int __b) {
16257 vector
bool int __b) {
16258 return __builtin_altivec_vcmpgtuw_p(
__CR6_LT_REV, (vector
unsigned int)
__b,
16265 (vector
signed int)
__a);
16269 vector
unsigned int __b) {
16271 (vector
unsigned int)
__a);
16275 vector
bool int __b) {
16276 return __builtin_altivec_vcmpgtuw_p(
__CR6_LT_REV, (vector
unsigned int)
__b,
16277 (vector
unsigned int)
__a);
16282 vector
signed long long __b) {
16287 vector
unsigned long long __b) {
16292 vector
bool long long __b) {
16294 (vector
signed long long)
__b,
__a);
16298 vector
bool long long __b) {
16300 (vector
unsigned long long)
__b,
__a);
16304 vector
signed long long __b) {
16306 (vector
signed long long)
__a);
16310 vector
unsigned long long __b) {
16312 (vector
unsigned long long)
__a);
16316 vector
bool long long __b) {
16318 (vector
unsigned long long)
__b,
16319 (vector
unsigned long long)
__a);
16324 vector
float __b) {
16334 vector
double __b) {
16339 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16341 vector
signed __int128
__b) {
16346 vector
unsigned __int128
__b) {
16354 vector
signed char __b) {
16359 vector
bool char __b) {
16361 (vector
signed char)
__b);
16365 vector
unsigned char __b) {
16370 vector
bool char __b) {
16372 (vector
unsigned char)
__b);
16376 vector
signed char __b) {
16377 return __builtin_altivec_vcmpgtsb_p(
__CR6_EQ_REV, (vector
signed char)
__a,
16382 vector
unsigned char __b) {
16383 return __builtin_altivec_vcmpgtub_p(
__CR6_EQ_REV, (vector
unsigned char)
__a,
16388 vector
bool char __b) {
16389 return __builtin_altivec_vcmpgtub_p(
__CR6_EQ_REV, (vector
unsigned char)
__a,
16390 (vector
unsigned char)
__b);
16394 vector
short __b) {
16399 vector
bool short __b) {
16404 vector
unsigned short __b) {
16409 vector
bool short __b) {
16411 (vector
unsigned short)
__b);
16415 vector
short __b) {
16416 return __builtin_altivec_vcmpgtsh_p(
__CR6_EQ_REV, (vector
signed short)
__a,
16421 vector
unsigned short __b) {
16422 return __builtin_altivec_vcmpgtuh_p(
__CR6_EQ_REV, (vector
unsigned short)
__a,
16427 vector
bool short __b) {
16428 return __builtin_altivec_vcmpgtuh_p(
__CR6_EQ_REV, (vector
unsigned short)
__a,
16429 (vector
unsigned short)
__b);
16437 vector
bool int __b) {
16442 vector
unsigned int __b) {
16447 vector
bool int __b) {
16449 (vector
unsigned int)
__b);
16454 return __builtin_altivec_vcmpgtsw_p(
__CR6_EQ_REV, (vector
signed int)
__a,
16459 vector
unsigned int __b) {
16460 return __builtin_altivec_vcmpgtuw_p(
__CR6_EQ_REV, (vector
unsigned int)
__a,
16465 vector
bool int __b) {
16466 return __builtin_altivec_vcmpgtuw_p(
__CR6_EQ_REV, (vector
unsigned int)
__a,
16467 (vector
unsigned int)
__b);
16472 vector
signed long long __b) {
16477 vector
unsigned long long __b) {
16482 vector
bool long long __b) {
16484 (vector
signed long long)
__b);
16488 vector
bool long long __b) {
16490 (vector
unsigned long long)
__b);
16494 vector
signed long long __b) {
16496 (vector
signed long long)
__a,
__b);
16500 vector
unsigned long long __b) {
16502 (vector
unsigned long long)
__a,
__b);
16506 vector
bool long long __b) {
16508 (vector
unsigned long long)
__a,
16509 (vector
unsigned long long)
__b);
16514 vector
float __b) {
16524 vector
double __b) {
16529 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16531 vector
signed __int128
__b) {
16536 vector
unsigned __int128
__b) {
16544 vector
signed char __b) {
16549 vector
bool char __b) {
16551 (vector
signed char)
__b);
16555 vector
unsigned char __b) {
16560 vector
bool char __b) {
16562 (vector
unsigned char)
__b);
16566 vector
signed char __b) {
16567 return __builtin_altivec_vcmpgtsb_p(
__CR6_LT_REV, (vector
signed char)
__a,
16572 vector
unsigned char __b) {
16573 return __builtin_altivec_vcmpgtub_p(
__CR6_LT_REV, (vector
unsigned char)
__a,
16578 vector
bool char __b) {
16579 return __builtin_altivec_vcmpgtub_p(
__CR6_LT_REV, (vector
unsigned char)
__a,
16580 (vector
unsigned char)
__b);
16584 vector
short __b) {
16589 vector
bool short __b) {
16594 vector
unsigned short __b) {
16599 vector
bool short __b) {
16601 (vector
unsigned short)
__b);
16605 vector
short __b) {
16606 return __builtin_altivec_vcmpgtsh_p(
__CR6_LT_REV, (vector
signed short)
__a,
16611 vector
unsigned short __b) {
16612 return __builtin_altivec_vcmpgtuh_p(
__CR6_LT_REV, (vector
unsigned short)
__a,
16617 vector
bool short __b) {
16618 return __builtin_altivec_vcmpgtuh_p(
__CR6_LT_REV, (vector
unsigned short)
__a,
16619 (vector
unsigned short)
__b);
16627 vector
bool int __b) {
16632 vector
unsigned int __b) {
16637 vector
bool int __b) {
16639 (vector
unsigned int)
__b);
16644 return __builtin_altivec_vcmpgtsw_p(
__CR6_LT_REV, (vector
signed int)
__a,
16649 vector
unsigned int __b) {
16650 return __builtin_altivec_vcmpgtuw_p(
__CR6_LT_REV, (vector
unsigned int)
__a,
16655 vector
bool int __b) {
16656 return __builtin_altivec_vcmpgtuw_p(
__CR6_LT_REV, (vector
unsigned int)
__a,
16657 (vector
unsigned int)
__b);
16662 vector
signed long long __b) {
16667 vector
unsigned long long __b) {
16672 vector
bool long long __b) {
16674 (vector
signed long long)
__b);
16678 vector
bool long long __b) {
16680 (vector
unsigned long long)
__b);
16684 vector
signed long long __b) {
16686 (vector
signed long long)
__a,
__b);
16690 vector
unsigned long long __b) {
16692 (vector
unsigned long long)
__a,
__b);
16696 vector
bool long long __b) {
16698 (vector
unsigned long long)
__a,
16699 (vector
unsigned long long)
__b);
16704 vector
float __b) {
16714 vector
double __b) {
16719 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16721 vector
signed __int128
__b) {
16726 vector
unsigned __int128
__b) {
16734 vector
signed char __b) {
16739 vector
bool char __b) {
16740 return __builtin_altivec_vcmpgtsb_p(
__CR6_EQ_REV, (vector
signed char)
__b,
16745 vector
unsigned char __b) {
16750 vector
bool char __b) {
16751 return __builtin_altivec_vcmpgtub_p(
__CR6_EQ_REV, (vector
unsigned char)
__b,
16756 vector
signed char __b) {
16758 (vector
signed char)
__a);
16762 vector
unsigned char __b) {
16764 (vector
unsigned char)
__a);
16768 vector
bool char __b) {
16769 return __builtin_altivec_vcmpgtub_p(
__CR6_EQ_REV, (vector
unsigned char)
__b,
16770 (vector
unsigned char)
__a);
16774 vector
short __b) {
16779 vector
bool short __b) {
16784 vector
unsigned short __b) {
16789 vector
bool short __b) {
16790 return __builtin_altivec_vcmpgtuh_p(
__CR6_EQ_REV, (vector
unsigned short)
__b,
16795 vector
short __b) {
16797 (vector
signed short)
__a);
16801 vector
unsigned short __b) {
16803 (vector
unsigned short)
__a);
16807 vector
bool short __b) {
16808 return __builtin_altivec_vcmpgtuh_p(
__CR6_EQ_REV, (vector
unsigned short)
__b,
16809 (vector
unsigned short)
__a);
16817 vector
bool int __b) {
16822 vector
unsigned int __b) {
16827 vector
bool int __b) {
16828 return __builtin_altivec_vcmpgtuw_p(
__CR6_EQ_REV, (vector
unsigned int)
__b,
16835 (vector
signed int)
__a);
16839 vector
unsigned int __b) {
16841 (vector
unsigned int)
__a);
16845 vector
bool int __b) {
16846 return __builtin_altivec_vcmpgtuw_p(
__CR6_EQ_REV, (vector
unsigned int)
__b,
16847 (vector
unsigned int)
__a);
16852 vector
signed long long __b) {
16857 vector
unsigned long long __b) {
16862 vector
bool long long __b) {
16864 (vector
signed long long)
__b,
__a);
16868 vector
bool long long __b) {
16870 (vector
unsigned long long)
__b,
__a);
16874 vector
signed long long __b) {
16876 (vector
signed long long)
__a);
16880 vector
unsigned long long __b) {
16882 (vector
unsigned long long)
__a);
16886 vector
bool long long __b) {
16888 (vector
unsigned long long)
__b,
16889 (vector
unsigned long long)
__a);
16894 vector
float __b) {
16904 vector
double __b) {
16909 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16911 vector
signed __int128
__b) {
16916 vector
unsigned __int128
__b) {
16939 vector
signed char __b) {
16945 vector
bool char __b) {
16951 vector
unsigned char __b) {
16957 vector
bool char __b) {
16963 vector
signed char __b) {
16969 vector
unsigned char __b) {
16975 vector
bool char __b) {
16981 vector
short __b) {
16986 vector
bool short __b) {
16991 vector
unsigned short __b) {
16993 (vector
short)
__b);
16997 vector
bool short __b) {
16999 (vector
short)
__b);
17003 vector
short __b) {
17005 (vector
short)
__b);
17009 vector
unsigned short __b) {
17011 (vector
short)
__b);
17015 vector
bool short __b) {
17017 (vector
short)
__b);
17021 vector pixel
__b) {
17023 (vector
short)
__b);
17031 vector
bool int __b) {
17036 vector
unsigned int __b) {
17042 vector
bool int __b) {
17054 vector
unsigned int __b) {
17060 vector
bool int __b) {
17067 vector
signed long long __b) {
17068 #ifdef __POWER8_VECTOR__
17078 vector
unsigned long long __b) {
17079 return vec_any_ne((vector
signed long long)
__a, (vector
signed long long)
__b);
17083 vector
bool long long __b) {
17084 return vec_any_ne((vector
signed long long)
__a, (vector
signed long long)
__b);
17088 vector
bool long long __b) {
17089 return vec_any_ne((vector
signed long long)
__a, (vector
signed long long)
__b);
17093 vector
signed long long __b) {
17094 return vec_any_ne((vector
signed long long)
__a, (vector
signed long long)
__b);
17098 vector
unsigned long long __b) {
17099 return vec_any_ne((vector
signed long long)
__a, (vector
signed long long)
__b);
17103 vector
bool long long __b) {
17104 return vec_any_ne((vector
signed long long)
__a, (vector
signed long long)
__b);
17109 vector
float __b) {
17119 vector
double __b) {
17124 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
17126 vector
signed __int128
__b) {
17131 vector
unsigned __int128
__b) {
17136 vector
bool __int128
__b) {
17144 vector
float __b) {
17154 vector
double __b) {
17162 vector
float __b) {
17172 vector
double __b) {
17180 vector
float __b) {
17190 vector
double __b) {
17198 vector
float __b) {
17208 vector
double __b) {
17232 vec_any_out(vector
float __a, vector
float __b) {
17250 #define vec_sbox_be __builtin_altivec_crypto_vsbox
17251 #define vec_cipher_be __builtin_altivec_crypto_vcipher
17252 #define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
17253 #define vec_ncipher_be __builtin_altivec_crypto_vncipher
17254 #define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
17257 static __inline__ vector
unsigned long long __attribute__((__always_inline__))
17258 __builtin_crypto_vsbox(vector
unsigned long long __a) {
17259 return __builtin_altivec_crypto_vsbox(
__a);
17262 static __inline__ vector
unsigned long long __attribute__((__always_inline__))
17263 __builtin_crypto_vcipher(vector
unsigned long long __a,
17264 vector
unsigned long long __b) {
17265 return __builtin_altivec_crypto_vcipher(
__a,
__b);
17268 static __inline__ vector
unsigned long long __attribute__((__always_inline__))
17269 __builtin_crypto_vcipherlast(vector
unsigned long long __a,
17270 vector
unsigned long long __b) {
17271 return __builtin_altivec_crypto_vcipherlast(
__a,
__b);
17274 static __inline__ vector
unsigned long long __attribute__((__always_inline__))
17275 __builtin_crypto_vncipher(vector
unsigned long long __a,
17276 vector
unsigned long long __b) {
17277 return __builtin_altivec_crypto_vncipher(
__a,
__b);
17280 static __inline__ vector
unsigned long long __attribute__((__always_inline__))
17281 __builtin_crypto_vncipherlast(vector
unsigned long long __a,
17282 vector
unsigned long long __b) {
17283 return __builtin_altivec_crypto_vncipherlast(
__a,
__b);
17287 #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
17288 #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
17290 #define vec_shasigma_be(X, Y, Z) \
17291 _Generic((X), vector unsigned int \
17292 : __builtin_crypto_vshasigmaw, vector unsigned long long \
17293 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
17296 #ifdef __POWER8_VECTOR__
17298 vec_permxor(vector
bool char __a, vector
bool char __b,
17299 vector
bool char __c) {
17300 return __builtin_altivec_crypto_vpermxor(
__a,
__b,
__c);
17304 vec_permxor(vector
signed char __a, vector
signed char __b,
17305 vector
signed char __c) {
17306 return __builtin_altivec_crypto_vpermxor(
__a,
__b,
__c);
17310 vec_permxor(vector
unsigned char __a, vector
unsigned char __b,
17311 vector
unsigned char __c) {
17312 return __builtin_altivec_crypto_vpermxor(
__a,
__b,
__c);
17316 __builtin_crypto_vpermxor(vector
unsigned char __a, vector
unsigned char __b,
17317 vector
unsigned char __c) {
17318 return __builtin_altivec_crypto_vpermxor(
__a,
__b,
__c);
17322 __builtin_crypto_vpermxor(vector
unsigned short __a, vector
unsigned short __b,
17323 vector
unsigned short __c) {
17324 return (vector
unsigned short)__builtin_altivec_crypto_vpermxor(
17325 (vector
unsigned char)
__a, (vector
unsigned char)
__b,
17326 (vector
unsigned char)
__c);
17329 static __inline__ vector
unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
17330 vector
unsigned int __a, vector
unsigned int __b, vector
unsigned int __c) {
17331 return (vector
unsigned int)__builtin_altivec_crypto_vpermxor(
17332 (vector
unsigned char)
__a, (vector
unsigned char)
__b,
17333 (vector
unsigned char)
__c);
17336 static __inline__ vector
unsigned long long __ATTRS_o_ai
17337 __builtin_crypto_vpermxor(vector
unsigned long long __a,
17338 vector
unsigned long long __b,
17339 vector
unsigned long long __c) {
17340 return (vector
unsigned long long)__builtin_altivec_crypto_vpermxor(
17341 (vector
unsigned char)
__a, (vector
unsigned char)
__b,
17342 (vector
unsigned char)
__c);
17346 __builtin_crypto_vpmsumb(vector
unsigned char __a, vector
unsigned char __b) {
17347 return __builtin_altivec_crypto_vpmsumb(
__a,
__b);
17351 __builtin_crypto_vpmsumb(vector
unsigned short __a, vector
unsigned short __b) {
17352 return __builtin_altivec_crypto_vpmsumh(
__a,
__b);
17356 __builtin_crypto_vpmsumb(vector
unsigned int __a, vector
unsigned int __b) {
17357 return __builtin_altivec_crypto_vpmsumw(
__a,
__b);
17360 static __inline__ vector
unsigned long long __ATTRS_o_ai
17361 __builtin_crypto_vpmsumb(vector
unsigned long long __a,
17362 vector
unsigned long long __b) {
17363 return __builtin_altivec_crypto_vpmsumd(
__a,
__b);
17367 vec_vgbbd(vector
signed char __a) {
17368 return __builtin_altivec_vgbbd((vector
unsigned char)
__a);
17371 #define vec_pmsum_be __builtin_crypto_vpmsumb
17372 #define vec_gb __builtin_altivec_vgbbd
17375 vec_vgbbd(vector
unsigned char __a) {
17376 return __builtin_altivec_vgbbd(
__a);
17379 static __inline__ vector
signed long long __ATTRS_o_ai
17380 vec_gbb(vector
signed long long __a) {
17381 return __builtin_altivec_vgbbd((vector
unsigned char)
__a);
17384 static __inline__ vector
unsigned long long __ATTRS_o_ai
17385 vec_gbb(vector
unsigned long long __a) {
17386 return __builtin_altivec_vgbbd((vector
unsigned char)
__a);
17390 vec_vbpermq(vector
signed char __a, vector
signed char __b) {
17391 return __builtin_altivec_vbpermq((vector
unsigned char)
__a,
17392 (vector
unsigned char)
__b);
17396 vec_vbpermq(vector
unsigned char __a, vector
unsigned char __b) {
17397 return __builtin_altivec_vbpermq(
__a,
__b);
17400 #if defined(__powerpc64__) && defined(__SIZEOF_INT128__)
17401 static __inline__ vector
unsigned long long __ATTRS_o_ai
17402 vec_bperm(vector
unsigned __int128
__a, vector
unsigned char __b) {
17403 return __builtin_altivec_vbpermq((vector
unsigned char)
__a,
17404 (vector
unsigned char)
__b);
17408 vec_bperm(vector
unsigned char __a, vector
unsigned char __b) {
17409 return __builtin_altivec_vbpermq(
__a,
__b);
17411 #endif // __POWER8_VECTOR__
17412 #ifdef __POWER9_VECTOR__
17413 static __inline__ vector
unsigned long long __ATTRS_o_ai
17414 vec_bperm(vector
unsigned long long __a, vector
unsigned char __b) {
17415 return __builtin_altivec_vbpermd(
__a,
__b);
17423 return __builtin_shufflevector(
__a,
__a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17428 return __builtin_shufflevector(
__a,
__a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17434 return __builtin_shufflevector(
__a,
__a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17439 return __builtin_shufflevector(
__a,
__a, 3, 2, 1, 0);
17443 return __builtin_shufflevector(
__a,
__a, 3, 2, 1, 0);
17448 return __builtin_shufflevector(
__a,
__a, 3, 2, 1, 0);
17452 return __builtin_shufflevector(
__a,
__a, 7, 6, 5, 4, 3, 2, 1, 0);
17457 return __builtin_shufflevector(
__a,
__a, 7, 6, 5, 4, 3, 2, 1, 0);
17462 return __builtin_shufflevector(
__a,
__a, 7, 6, 5, 4, 3, 2, 1, 0);
17466 return __builtin_shufflevector(
__a,
__a, 3, 2, 1, 0);
17472 return __builtin_shufflevector(
__a,
__a, 1, 0);
17477 return __builtin_shufflevector(
__a,
__a, 1, 0);
17482 return __builtin_shufflevector(
__a,
__a, 1, 0);
17486 return __builtin_shufflevector(
__a,
__a, 1, 0);
17508 vector
unsigned char __indices =
17509 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17515 vector
unsigned char __indices =
17516 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17522 vector
unsigned char __indices =
17523 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17529 vector
unsigned char __indices =
17530 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17536 vector
unsigned char __indices =
17537 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17543 vector
unsigned char __indices =
17544 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17550 vector
unsigned char __indices =
17551 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17558 vector
unsigned char __indices =
17559 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17563 static __inline__ vector
signed long long __ATTRS_o_ai
17565 vector
unsigned char __indices =
17566 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17570 static __inline__ vector
unsigned long long __ATTRS_o_ai
17572 vector
unsigned char __indices =
17573 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17579 vector
unsigned char __indices =
17580 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17585 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17586 defined(__SIZEOF_INT128__)
17589 vector
unsigned char __indices =
17590 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
17591 return (vector
signed __int128)
vec_perm((vector
signed int)
__a,
17592 (vector
signed int)
__a,
17596 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
17598 vector
unsigned char __indices =
17599 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
17600 return (vector
unsigned __int128)
vec_perm((vector
signed int)
__a,
17601 (vector
signed int)
__a,
17608 #define vec_xld2 vec_xl
17609 #define vec_xlw4 vec_xl
17611 typedef vector
unsigned char unaligned_vec_uchar
__attribute__((aligned(1)));
17612 typedef vector
signed short unaligned_vec_sshort
__attribute__((aligned(1)));
17613 typedef vector
unsigned short unaligned_vec_ushort
__attribute__((aligned(1)));
17614 typedef vector
signed int unaligned_vec_sint
__attribute__((aligned(1)));
17615 typedef vector
unsigned int unaligned_vec_uint
__attribute__((aligned(1)));
17616 typedef vector
float unaligned_vec_float
__attribute__((aligned(1)));
17619 const signed char *__ptr) {
17620 return *(unaligned_vec_schar *)(__ptr + __offset);
17625 return *(unaligned_vec_uchar*)(__ptr + __offset);
17630 signed char *__addr = (
signed char *)__ptr + __offset;
17631 return *(unaligned_vec_sshort *)__addr;
17636 signed char *__addr = (
signed char *)__ptr + __offset;
17637 return *(unaligned_vec_ushort *)__addr;
17641 const signed int *__ptr) {
17642 signed char *__addr = (
signed char *)__ptr + __offset;
17643 return *(unaligned_vec_sint *)__addr;
17648 signed char *__addr = (
signed char *)__ptr + __offset;
17649 return *(unaligned_vec_uint *)__addr;
17653 const float *__ptr) {
17654 signed char *__addr = (
signed char *)__ptr + __offset;
17655 return *(unaligned_vec_float *)__addr;
17659 typedef vector
signed long long unaligned_vec_sll
__attribute__((aligned(1)));
17660 typedef vector
unsigned long long unaligned_vec_ull
__attribute__((aligned(1)));
17661 typedef vector
double unaligned_vec_double
__attribute__((aligned(1)));
17665 signed char *__addr = (
signed char *)__ptr + __offset;
17666 return *(unaligned_vec_sll *)__addr;
17671 signed char *__addr = (
signed char *)__ptr + __offset;
17672 return *(unaligned_vec_ull *)__addr;
17676 const double *__ptr) {
17677 signed char *__addr = (
signed char *)__ptr + __offset;
17678 return *(unaligned_vec_double *)__addr;
17682 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17683 defined(__SIZEOF_INT128__)
17684 typedef vector
signed __int128 unaligned_vec_si128
__attribute__((aligned(1)));
17685 typedef vector
unsigned __int128 unaligned_vec_ui128
17689 signed char *__addr = (
signed char *)__ptr + __offset;
17690 return *(unaligned_vec_si128 *)__addr;
17695 signed char *__addr = (
signed char *)__ptr + __offset;
17696 return *(unaligned_vec_ui128 *)__addr;
17702 #ifdef __LITTLE_ENDIAN__
17705 vector
signed char __vec = (vector
signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17706 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17707 13, 12, 11, 10, 9, 8);
17712 vector
unsigned char __vec = (vector
unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17713 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17714 13, 12, 11, 10, 9, 8);
17719 vector
signed short __vec = (vector
signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17720 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17725 vector
unsigned short __vec = (vector
unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17726 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17730 vec_xl_be(
signed long long __offset,
const signed int *__ptr) {
17731 return (vector
signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
17735 vec_xl_be(
signed long long __offset,
const unsigned int *__ptr) {
17736 return (vector
unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
17740 vec_xl_be(
signed long long __offset,
const float *__ptr) {
17741 return (vector
float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
17745 static __inline__ vector
signed long long __ATTRS_o_ai
17746 vec_xl_be(
signed long long __offset,
const signed long long *__ptr) {
17747 return (vector
signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17750 static __inline__ vector
unsigned long long __ATTRS_o_ai
17751 vec_xl_be(
signed long long __offset,
const unsigned long long *__ptr) {
17752 return (vector
unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17756 vec_xl_be(
signed long long __offset,
const double *__ptr) {
17757 return (vector
double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17761 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17762 defined(__SIZEOF_INT128__)
17764 vec_xl_be(
signed long long __offset,
const signed __int128 *__ptr) {
17765 return vec_xl(__offset, __ptr);
17768 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
17769 vec_xl_be(
signed long long __offset,
const unsigned __int128 *__ptr) {
17770 return vec_xl(__offset, __ptr);
17774 #define vec_xl_be vec_xl
17777 #if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
17778 defined(__SIZEOF_INT128__)
17782 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
17783 vec_xl_sext(
ptrdiff_t __offset,
const signed char *__pointer) {
17784 return (vector
unsigned __int128)*(__pointer + __offset);
17787 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
17788 vec_xl_sext(
ptrdiff_t __offset,
const signed short *__pointer) {
17789 return (vector
unsigned __int128)*(__pointer + __offset);
17792 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
17793 vec_xl_sext(
ptrdiff_t __offset,
const signed int *__pointer) {
17794 return (vector
unsigned __int128)*(__pointer + __offset);
17797 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
17798 vec_xl_sext(
ptrdiff_t __offset,
const signed long long *__pointer) {
17799 return (vector
unsigned __int128)*(__pointer + __offset);
17804 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
17805 vec_xl_zext(
ptrdiff_t __offset,
const unsigned char *__pointer) {
17806 return (vector
unsigned __int128)*(__pointer + __offset);
17809 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
17810 vec_xl_zext(
ptrdiff_t __offset,
const unsigned short *__pointer) {
17811 return (vector
unsigned __int128)*(__pointer + __offset);
17814 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
17815 vec_xl_zext(
ptrdiff_t __offset,
const unsigned int *__pointer) {
17816 return (vector
unsigned __int128)*(__pointer + __offset);
17819 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
17820 vec_xl_zext(
ptrdiff_t __offset,
const unsigned long long *__pointer) {
17821 return (vector
unsigned __int128)*(__pointer + __offset);
17828 static __inline__ vector
signed long long __ATTRS_o_ai
17829 vec_xlds(
ptrdiff_t __offset,
const signed long long *__ptr) {
17830 signed long long *__addr = (
signed long long*)((
signed char *)__ptr + __offset);
17831 return (vector
signed long long) *__addr;
17834 static __inline__ vector
unsigned long long __ATTRS_o_ai
17835 vec_xlds(
ptrdiff_t __offset,
const unsigned long long *__ptr) {
17836 unsigned long long *__addr = (
unsigned long long *)((
signed char *)__ptr + __offset);
17837 return (unaligned_vec_ull) *__addr;
17841 const double *__ptr) {
17842 double *__addr = (
double*)((
signed char *)__ptr + __offset);
17843 return (unaligned_vec_double) *__addr;
17848 vec_load_splats(
signed long long __offset,
const signed int *__ptr) {
17849 signed int *__addr = (
signed int*)((
signed char *)__ptr + __offset);
17850 return (vector
signed int)*__addr;
17854 vec_load_splats(
unsigned long long __offset,
const signed int *__ptr) {
17855 signed int *__addr = (
signed int*)((
signed char *)__ptr + __offset);
17856 return (vector
signed int)*__addr;
17860 vec_load_splats(
signed long long __offset,
const unsigned int *__ptr) {
17861 unsigned int *__addr = (
unsigned int*)((
signed char *)__ptr + __offset);
17862 return (vector
unsigned int)*__addr;
17866 vec_load_splats(
unsigned long long __offset,
const unsigned int *__ptr) {
17867 unsigned int *__addr = (
unsigned int*)((
signed char *)__ptr + __offset);
17868 return (vector
unsigned int)*__addr;
17872 vec_load_splats(
signed long long __offset,
const float *__ptr) {
17873 float *__addr = (
float*)((
signed char *)__ptr + __offset);
17874 return (vector
float)*__addr;
17878 vec_load_splats(
unsigned long long __offset,
const float *__ptr) {
17879 float *__addr = (
float*)((
signed char *)__ptr + __offset);
17880 return (vector
float)*__addr;
17886 #define vec_xstd2 vec_xst
17887 #define vec_xstw4 vec_xst
17890 *(unaligned_vec_schar *)(__ptr + __offset) = __vec;
17895 *(unaligned_vec_uchar *)(__ptr + __offset) = __vec;
17900 signed char *__addr = (
signed char *)__ptr + __offset;
17901 *(unaligned_vec_sshort *)__addr = __vec;
17906 unsigned short *__ptr) {
17907 signed char *__addr = (
signed char *)__ptr + __offset;
17908 *(unaligned_vec_ushort *)__addr = __vec;
17912 ptrdiff_t __offset,
signed int *__ptr) {
17913 signed char *__addr = (
signed char *)__ptr + __offset;
17914 *(unaligned_vec_sint *)__addr = __vec;
17919 signed char *__addr = (
signed char *)__ptr + __offset;
17920 *(unaligned_vec_uint *)__addr = __vec;
17925 signed char *__addr = (
signed char *)__ptr + __offset;
17926 *(unaligned_vec_float *)__addr = __vec;
17932 signed long long *__ptr) {
17933 signed char *__addr = (
signed char *)__ptr + __offset;
17934 *(unaligned_vec_sll *)__addr = __vec;
17939 unsigned long long *__ptr) {
17940 signed char *__addr = (
signed char *)__ptr + __offset;
17941 *(unaligned_vec_ull *)__addr = __vec;
17946 signed char *__addr = (
signed char *)__ptr + __offset;
17947 *(unaligned_vec_double *)__addr = __vec;
17951 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17952 defined(__SIZEOF_INT128__)
17955 signed __int128 *__ptr) {
17956 signed char *__addr = (
signed char *)__ptr + __offset;
17957 *(unaligned_vec_si128 *)__addr = __vec;
17962 unsigned __int128 *__ptr) {
17963 signed char *__addr = (
signed char *)__ptr + __offset;
17964 *(unaligned_vec_ui128 *)__addr = __vec;
17970 #if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
17971 defined(__SIZEOF_INT128__)
17972 static inline __ATTRS_o_ai void vec_xst_trunc(vector
signed __int128 __vec,
17974 signed char *__ptr) {
17975 *(__ptr + __offset) = (
signed char)__vec[0];
17978 static inline __ATTRS_o_ai void vec_xst_trunc(vector
unsigned __int128 __vec,
17980 unsigned char *__ptr) {
17981 *(__ptr + __offset) = (
unsigned char)__vec[0];
17984 static inline __ATTRS_o_ai void vec_xst_trunc(vector
signed __int128 __vec,
17986 signed short *__ptr) {
17987 *(__ptr + __offset) = (
signed short)__vec[0];
17990 static inline __ATTRS_o_ai void vec_xst_trunc(vector
unsigned __int128 __vec,
17992 unsigned short *__ptr) {
17993 *(__ptr + __offset) = (
unsigned short)__vec[0];
17996 static inline __ATTRS_o_ai void vec_xst_trunc(vector
signed __int128 __vec,
17998 signed int *__ptr) {
17999 *(__ptr + __offset) = (
signed int)__vec[0];
18002 static inline __ATTRS_o_ai void vec_xst_trunc(vector
unsigned __int128 __vec,
18004 unsigned int *__ptr) {
18005 *(__ptr + __offset) = (
unsigned int)__vec[0];
18008 static inline __ATTRS_o_ai void vec_xst_trunc(vector
signed __int128 __vec,
18010 signed long long *__ptr) {
18011 *(__ptr + __offset) = (
signed long long)__vec[0];
18014 static inline __ATTRS_o_ai void vec_xst_trunc(vector
unsigned __int128 __vec,
18016 unsigned long long *__ptr) {
18017 *(__ptr + __offset) = (
unsigned long long)__vec[0];
18023 #ifdef __LITTLE_ENDIAN__
18025 signed long long __offset,
18026 signed char *__ptr) {
18027 vector
signed char __tmp =
18028 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
18029 13, 12, 11, 10, 9, 8);
18030 typedef __attribute__((vector_size(
sizeof(__tmp))))
double __vector_double;
18031 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
18035 signed long long __offset,
18036 unsigned char *__ptr) {
18037 vector
unsigned char __tmp =
18038 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
18039 13, 12, 11, 10, 9, 8);
18040 typedef __attribute__((vector_size(
sizeof(__tmp))))
double __vector_double;
18041 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
18045 signed long long __offset,
18046 signed short *__ptr) {
18047 vector
signed short __tmp =
18048 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
18049 typedef __attribute__((vector_size(
sizeof(__tmp))))
double __vector_double;
18050 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
18054 signed long long __offset,
18055 unsigned short *__ptr) {
18056 vector
unsigned short __tmp =
18057 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
18058 typedef __attribute__((vector_size(
sizeof(__tmp))))
double __vector_double;
18059 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
18063 signed long long __offset,
18064 signed int *__ptr) {
18065 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
18069 signed long long __offset,
18070 unsigned int *__ptr) {
18071 __builtin_vsx_stxvw4x_be((vector
int)__vec, __offset, __ptr);
18075 signed long long __offset,
18077 __builtin_vsx_stxvw4x_be((vector
int)__vec, __offset, __ptr);
18082 signed long long __offset,
18083 signed long long *__ptr) {
18084 __builtin_vsx_stxvd2x_be((vector
double)__vec, __offset, __ptr);
18088 signed long long __offset,
18089 unsigned long long *__ptr) {
18090 __builtin_vsx_stxvd2x_be((vector
double)__vec, __offset, __ptr);
18094 signed long long __offset,
18096 __builtin_vsx_stxvd2x_be((vector
double)__vec, __offset, __ptr);
18100 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
18101 defined(__SIZEOF_INT128__)
18103 signed long long __offset,
18104 signed __int128 *__ptr) {
18105 vec_xst(__vec, __offset, __ptr);
18109 signed long long __offset,
18110 unsigned __int128 *__ptr) {
18111 vec_xst(__vec, __offset, __ptr);
18115 #define vec_xst_be vec_xst
18118 #ifdef __POWER9_VECTOR__
18119 #define vec_test_data_class(__a, __b) \
18121 (__a), vector float \
18122 : (vector bool int)__builtin_vsx_xvtstdcsp((vector float)(__a), (__b)), \
18124 : (vector bool long long)__builtin_vsx_xvtstdcdp((vector double)(__a), \
18169 #ifdef __POWER8_VECTOR__
18171 return __builtin_altivec_vminsd(
__a, -
__a);
18176 return __builtin_altivec_vminsw(
__a, -
__a);
18180 return __builtin_altivec_vminsh(
__a, -
__a);
18184 return __builtin_altivec_vminsb(
__a, -
__a);
18188 vector
float __b) {
18189 return __builtin_ppc_recipdivf(
__a,
__b);
18194 vector
double __b) {
18195 return __builtin_ppc_recipdivd(
__a,
__b);
18199 #ifdef __POWER10_VECTOR__
18204 vec_extractm(vector
unsigned char __a) {
18205 return __builtin_altivec_vextractbm(
__a);
18209 vec_extractm(vector
unsigned short __a) {
18210 return __builtin_altivec_vextracthm(
__a);
18214 vec_extractm(vector
unsigned int __a) {
18215 return __builtin_altivec_vextractwm(
__a);
18219 vec_extractm(vector
unsigned long long __a) {
18220 return __builtin_altivec_vextractdm(
__a);
18223 #ifdef __SIZEOF_INT128__
18225 vec_extractm(vector
unsigned __int128
__a) {
18226 return __builtin_altivec_vextractqm(
__a);
18233 vec_expandm(vector
unsigned char __a) {
18234 return __builtin_altivec_vexpandbm(
__a);
18238 vec_expandm(vector
unsigned short __a) {
18239 return __builtin_altivec_vexpandhm(
__a);
18243 vec_expandm(vector
unsigned int __a) {
18244 return __builtin_altivec_vexpandwm(
__a);
18247 static __inline__ vector
unsigned long long __ATTRS_o_ai
18248 vec_expandm(vector
unsigned long long __a) {
18249 return __builtin_altivec_vexpanddm(
__a);
18252 #ifdef __SIZEOF_INT128__
18253 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
18254 vec_expandm(vector
unsigned __int128
__a) {
18255 return __builtin_altivec_vexpandqm(
__a);
18261 #define vec_cntm(__a, __mp) \
18262 _Generic((__a), vector unsigned char \
18263 : __builtin_altivec_vcntmbb((__a), (unsigned char)(__mp)), \
18264 vector unsigned short \
18265 : __builtin_altivec_vcntmbh((__a), (unsigned char)(__mp)), \
18266 vector unsigned int \
18267 : __builtin_altivec_vcntmbw((__a), (unsigned char)(__mp)), \
18268 vector unsigned long long \
18269 : __builtin_altivec_vcntmbd((__a), (unsigned char)(__mp)))
18274 vec_genbm(
unsigned long long __bm) {
18275 return __builtin_altivec_mtvsrbm(__bm);
18279 vec_genhm(
unsigned long long __bm) {
18280 return __builtin_altivec_mtvsrhm(__bm);
18284 vec_genwm(
unsigned long long __bm) {
18285 return __builtin_altivec_mtvsrwm(__bm);
18288 static __inline__ vector
unsigned long long __ATTRS_o_ai
18289 vec_gendm(
unsigned long long __bm) {
18290 return __builtin_altivec_mtvsrdm(__bm);
18293 #ifdef __SIZEOF_INT128__
18294 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
18295 vec_genqm(
unsigned long long __bm) {
18296 return __builtin_altivec_mtvsrqm(__bm);
18302 static __inline__ vector
unsigned long long __ATTRS_o_ai
18303 vec_pdep(vector
unsigned long long __a, vector
unsigned long long __b) {
18304 return __builtin_altivec_vpdepd(
__a,
__b);
18309 static __inline__ vector
unsigned long long __ATTRS_o_ai
18310 vec_pext(vector
unsigned long long __a, vector
unsigned long long __b) {
18311 return __builtin_altivec_vpextd(
__a,
__b);
18316 static __inline__ vector
unsigned long long __ATTRS_o_ai
18317 vec_cfuge(vector
unsigned long long __a, vector
unsigned long long __b) {
18318 return __builtin_altivec_vcfuged(
__a,
__b);
18323 #define vec_gnb(__a, __b) __builtin_altivec_vgnb(__a, __b)
18327 #ifdef __SIZEOF_INT128__
18328 #define vec_ternarylogic(__a, __b, __c, __imm) \
18329 _Generic((__a), vector unsigned char \
18330 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18331 (vector unsigned long long)(__b), \
18332 (vector unsigned long long)(__c), (__imm)), \
18333 vector unsigned short \
18334 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18335 (vector unsigned long long)(__b), \
18336 (vector unsigned long long)(__c), (__imm)), \
18337 vector unsigned int \
18338 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18339 (vector unsigned long long)(__b), \
18340 (vector unsigned long long)(__c), (__imm)), \
18341 vector unsigned long long \
18342 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18343 (vector unsigned long long)(__b), \
18344 (vector unsigned long long)(__c), (__imm)), \
18345 vector unsigned __int128 \
18346 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18347 (vector unsigned long long)(__b), \
18348 (vector unsigned long long)(__c), (__imm)))
18350 #define vec_ternarylogic(__a, __b, __c, __imm) \
18351 _Generic((__a), vector unsigned char \
18352 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18353 (vector unsigned long long)(__b), \
18354 (vector unsigned long long)(__c), (__imm)), \
18355 vector unsigned short \
18356 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18357 (vector unsigned long long)(__b), \
18358 (vector unsigned long long)(__c), (__imm)), \
18359 vector unsigned int \
18360 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18361 (vector unsigned long long)(__b), \
18362 (vector unsigned long long)(__c), (__imm)), \
18363 vector unsigned long long \
18364 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
18365 (vector unsigned long long)(__b), \
18366 (vector unsigned long long)(__c), (__imm)))
18373 #define vec_genpcvm(__a, __imm) \
18374 _Generic((__a), vector unsigned char \
18375 : __builtin_vsx_xxgenpcvbm((__a), (int)(__imm)), \
18376 vector unsigned short \
18377 : __builtin_vsx_xxgenpcvhm((__a), (int)(__imm)), \
18378 vector unsigned int \
18379 : __builtin_vsx_xxgenpcvwm((__a), (int)(__imm)), \
18380 vector unsigned long long \
18381 : __builtin_vsx_xxgenpcvdm((__a), (int)(__imm)))
18387 vec_clr_first(vector
signed char __a,
unsigned int __n) {
18388 #ifdef __LITTLE_ENDIAN__
18389 return __builtin_altivec_vclrrb(
__a, __n);
18391 return __builtin_altivec_vclrlb(
__a, __n);
18396 vec_clr_first(vector
unsigned char __a,
unsigned int __n) {
18397 #ifdef __LITTLE_ENDIAN__
18398 return __builtin_altivec_vclrrb((vector
signed char)
__a, __n);
18400 return __builtin_altivec_vclrlb((vector
signed char)
__a, __n);
18407 vec_clr_last(vector
signed char __a,
unsigned int __n) {
18408 #ifdef __LITTLE_ENDIAN__
18409 return __builtin_altivec_vclrlb(
__a, __n);
18411 return __builtin_altivec_vclrrb(
__a, __n);
18416 vec_clr_last(vector
unsigned char __a,
unsigned int __n) {
18417 #ifdef __LITTLE_ENDIAN__
18418 return __builtin_altivec_vclrlb((vector
signed char)
__a, __n);
18420 return __builtin_altivec_vclrrb((vector
signed char)
__a, __n);
18426 static __inline__ vector
unsigned long long __ATTRS_o_ai
18427 vec_cntlzm(vector
unsigned long long __a, vector
unsigned long long __b) {
18428 return __builtin_altivec_vclzdm(
__a,
__b);
18433 static __inline__ vector
unsigned long long __ATTRS_o_ai
18434 vec_cnttzm(vector
unsigned long long __a, vector
unsigned long long __b) {
18435 return __builtin_altivec_vctzdm(
__a,
__b);
18441 vec_mod(vector
signed int __a, vector
signed int __b) {
18446 vec_mod(vector
unsigned int __a, vector
unsigned int __b) {
18450 static __inline__ vector
signed long long __ATTRS_o_ai
18451 vec_mod(vector
signed long long __a, vector
signed long long __b) {
18455 static __inline__ vector
unsigned long long __ATTRS_o_ai
18456 vec_mod(vector
unsigned long long __a, vector
unsigned long long __b) {
18460 #ifdef __SIZEOF_INT128__
18462 vec_mod(vector
signed __int128
__a, vector
signed __int128
__b) {
18466 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
18467 vec_mod(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
18474 #define vec_sldb(__a, __b, __c) __builtin_altivec_vsldbi(__a, __b, (__c & 0x7))
18478 #define vec_srdb(__a, __b, __c) __builtin_altivec_vsrdbi(__a, __b, (__c & 0x7))
18483 vec_insertl(
unsigned char __a, vector
unsigned char __b,
unsigned int __c) {
18484 #ifdef __LITTLE_ENDIAN__
18485 return __builtin_altivec_vinsbrx(
__b,
__c,
__a);
18487 return __builtin_altivec_vinsblx(
__b,
__c,
__a);
18492 vec_insertl(
unsigned short __a, vector
unsigned short __b,
unsigned int __c) {
18493 #ifdef __LITTLE_ENDIAN__
18494 return __builtin_altivec_vinshrx(
__b,
__c,
__a);
18496 return __builtin_altivec_vinshlx(
__b,
__c,
__a);
18501 vec_insertl(
unsigned int __a, vector
unsigned int __b,
unsigned int __c) {
18502 #ifdef __LITTLE_ENDIAN__
18503 return __builtin_altivec_vinswrx(
__b,
__c,
__a);
18505 return __builtin_altivec_vinswlx(
__b,
__c,
__a);
18509 static __inline__ vector
unsigned long long __ATTRS_o_ai
18510 vec_insertl(
unsigned long long __a, vector
unsigned long long __b,
18511 unsigned int __c) {
18512 #ifdef __LITTLE_ENDIAN__
18513 return __builtin_altivec_vinsdrx(
__b,
__c,
__a);
18515 return __builtin_altivec_vinsdlx(
__b,
__c,
__a);
18520 vec_insertl(vector
unsigned char __a, vector
unsigned char __b,
18521 unsigned int __c) {
18522 #ifdef __LITTLE_ENDIAN__
18523 return __builtin_altivec_vinsbvrx(
__b,
__c,
__a);
18525 return __builtin_altivec_vinsbvlx(
__b,
__c,
__a);
18530 vec_insertl(vector
unsigned short __a, vector
unsigned short __b,
18531 unsigned int __c) {
18532 #ifdef __LITTLE_ENDIAN__
18533 return __builtin_altivec_vinshvrx(
__b,
__c,
__a);
18535 return __builtin_altivec_vinshvlx(
__b,
__c,
__a);
18540 vec_insertl(vector
unsigned int __a, vector
unsigned int __b,
18541 unsigned int __c) {
18542 #ifdef __LITTLE_ENDIAN__
18543 return __builtin_altivec_vinswvrx(
__b,
__c,
__a);
18545 return __builtin_altivec_vinswvlx(
__b,
__c,
__a);
18552 vec_inserth(
unsigned char __a, vector
unsigned char __b,
unsigned int __c) {
18553 #ifdef __LITTLE_ENDIAN__
18554 return __builtin_altivec_vinsblx(
__b,
__c,
__a);
18556 return __builtin_altivec_vinsbrx(
__b,
__c,
__a);
18561 vec_inserth(
unsigned short __a, vector
unsigned short __b,
unsigned int __c) {
18562 #ifdef __LITTLE_ENDIAN__
18563 return __builtin_altivec_vinshlx(
__b,
__c,
__a);
18565 return __builtin_altivec_vinshrx(
__b,
__c,
__a);
18570 vec_inserth(
unsigned int __a, vector
unsigned int __b,
unsigned int __c) {
18571 #ifdef __LITTLE_ENDIAN__
18572 return __builtin_altivec_vinswlx(
__b,
__c,
__a);
18574 return __builtin_altivec_vinswrx(
__b,
__c,
__a);
18578 static __inline__ vector
unsigned long long __ATTRS_o_ai
18579 vec_inserth(
unsigned long long __a, vector
unsigned long long __b,
18580 unsigned int __c) {
18581 #ifdef __LITTLE_ENDIAN__
18582 return __builtin_altivec_vinsdlx(
__b,
__c,
__a);
18584 return __builtin_altivec_vinsdrx(
__b,
__c,
__a);
18589 vec_inserth(vector
unsigned char __a, vector
unsigned char __b,
18590 unsigned int __c) {
18591 #ifdef __LITTLE_ENDIAN__
18592 return __builtin_altivec_vinsbvlx(
__b,
__c,
__a);
18594 return __builtin_altivec_vinsbvrx(
__b,
__c,
__a);
18599 vec_inserth(vector
unsigned short __a, vector
unsigned short __b,
18600 unsigned int __c) {
18601 #ifdef __LITTLE_ENDIAN__
18602 return __builtin_altivec_vinshvlx(
__b,
__c,
__a);
18604 return __builtin_altivec_vinshvrx(
__b,
__c,
__a);
18609 vec_inserth(vector
unsigned int __a, vector
unsigned int __b,
18610 unsigned int __c) {
18611 #ifdef __LITTLE_ENDIAN__
18612 return __builtin_altivec_vinswvlx(
__b,
__c,
__a);
18614 return __builtin_altivec_vinswvrx(
__b,
__c,
__a);
18620 static __inline__ vector
unsigned long long __ATTRS_o_ai vec_extractl(
18621 vector
unsigned char __a, vector
unsigned char __b,
unsigned int __c) {
18622 #ifdef __LITTLE_ENDIAN__
18623 return __builtin_altivec_vextdubvrx(
__a,
__b,
__c);
18625 vector
unsigned long long __ret = __builtin_altivec_vextdubvlx(
__a,
__b,
__c);
18626 return vec_sld(__ret, __ret, 8);
18630 static __inline__ vector
unsigned long long __ATTRS_o_ai vec_extractl(
18631 vector
unsigned short __a, vector
unsigned short __b,
unsigned int __c) {
18632 #ifdef __LITTLE_ENDIAN__
18633 return __builtin_altivec_vextduhvrx(
__a,
__b,
__c);
18635 vector
unsigned long long __ret = __builtin_altivec_vextduhvlx(
__a,
__b,
__c);
18636 return vec_sld(__ret, __ret, 8);
18640 static __inline__ vector
unsigned long long __ATTRS_o_ai vec_extractl(
18641 vector
unsigned int __a, vector
unsigned int __b,
unsigned int __c) {
18642 #ifdef __LITTLE_ENDIAN__
18643 return __builtin_altivec_vextduwvrx(
__a,
__b,
__c);
18645 vector
unsigned long long __ret = __builtin_altivec_vextduwvlx(
__a,
__b,
__c);
18646 return vec_sld(__ret, __ret, 8);
18650 static __inline__ vector
unsigned long long __ATTRS_o_ai
18651 vec_extractl(vector
unsigned long long __a, vector
unsigned long long __b,
18652 unsigned int __c) {
18653 #ifdef __LITTLE_ENDIAN__
18654 return __builtin_altivec_vextddvrx(
__a,
__b,
__c);
18656 vector
unsigned long long __ret = __builtin_altivec_vextddvlx(
__a,
__b,
__c);
18657 return vec_sld(__ret, __ret, 8);
18663 static __inline__ vector
unsigned long long __ATTRS_o_ai vec_extracth(
18664 vector
unsigned char __a, vector
unsigned char __b,
unsigned int __c) {
18665 #ifdef __LITTLE_ENDIAN__
18666 return __builtin_altivec_vextdubvlx(
__a,
__b,
__c);
18668 vector
unsigned long long __ret = __builtin_altivec_vextdubvrx(
__a,
__b,
__c);
18669 return vec_sld(__ret, __ret, 8);
18673 static __inline__ vector
unsigned long long __ATTRS_o_ai vec_extracth(
18674 vector
unsigned short __a, vector
unsigned short __b,
unsigned int __c) {
18675 #ifdef __LITTLE_ENDIAN__
18676 return __builtin_altivec_vextduhvlx(
__a,
__b,
__c);
18678 vector
unsigned long long __ret = __builtin_altivec_vextduhvrx(
__a,
__b,
__c);
18679 return vec_sld(__ret, __ret, 8);
18683 static __inline__ vector
unsigned long long __ATTRS_o_ai vec_extracth(
18684 vector
unsigned int __a, vector
unsigned int __b,
unsigned int __c) {
18685 #ifdef __LITTLE_ENDIAN__
18686 return __builtin_altivec_vextduwvlx(
__a,
__b,
__c);
18688 vector
unsigned long long __ret = __builtin_altivec_vextduwvrx(
__a,
__b,
__c);
18689 return vec_sld(__ret, __ret, 8);
18693 static __inline__ vector
unsigned long long __ATTRS_o_ai
18694 vec_extracth(vector
unsigned long long __a, vector
unsigned long long __b,
18695 unsigned int __c) {
18696 #ifdef __LITTLE_ENDIAN__
18697 return __builtin_altivec_vextddvlx(
__a,
__b,
__c);
18699 vector
unsigned long long __ret = __builtin_altivec_vextddvrx(
__a,
__b,
__c);
18700 return vec_sld(__ret, __ret, 8);
18708 #define vec_permx(__a, __b, __c, __d) \
18709 __builtin_vsx_xxpermx((__a), (__b), (__c), (__d))
18714 vec_blendv(vector
signed char __a, vector
signed char __b,
18715 vector
unsigned char __c) {
18716 return __builtin_vsx_xxblendvb(
__a,
__b,
__c);
18720 vec_blendv(vector
unsigned char __a, vector
unsigned char __b,
18721 vector
unsigned char __c) {
18722 return __builtin_vsx_xxblendvb(
__a,
__b,
__c);
18726 vec_blendv(vector
signed short __a, vector
signed short __b,
18727 vector
unsigned short __c) {
18728 return __builtin_vsx_xxblendvh(
__a,
__b,
__c);
18732 vec_blendv(vector
unsigned short __a, vector
unsigned short __b,
18733 vector
unsigned short __c) {
18734 return __builtin_vsx_xxblendvh(
__a,
__b,
__c);
18738 vec_blendv(vector
signed int __a, vector
signed int __b,
18739 vector
unsigned int __c) {
18740 return __builtin_vsx_xxblendvw(
__a,
__b,
__c);
18744 vec_blendv(vector
unsigned int __a, vector
unsigned int __b,
18745 vector
unsigned int __c) {
18746 return __builtin_vsx_xxblendvw(
__a,
__b,
__c);
18749 static __inline__ vector
signed long long __ATTRS_o_ai
18750 vec_blendv(vector
signed long long __a, vector
signed long long __b,
18751 vector
unsigned long long __c) {
18752 return __builtin_vsx_xxblendvd(
__a,
__b,
__c);
18755 static __inline__ vector
unsigned long long __ATTRS_o_ai
18756 vec_blendv(vector
unsigned long long __a, vector
unsigned long long __b,
18757 vector
unsigned long long __c) {
18758 return __builtin_vsx_xxblendvd(
__a,
__b,
__c);
18762 vec_blendv(vector
float __a, vector
float __b, vector
unsigned int __c) {
18763 return __builtin_vsx_xxblendvw(
__a,
__b,
__c);
18767 vec_blendv(vector
double __a, vector
double __b,
18768 vector
unsigned long long __c) {
18769 return __builtin_vsx_xxblendvd(
__a,
__b,
__c);
18774 #define vec_replace_elt __builtin_altivec_vec_replace_elt
18778 #define vec_replace_unaligned __builtin_altivec_vec_replace_unaligned
18782 #define vec_splati(__a) \
18783 _Generic((__a), signed int \
18784 : ((vector signed int)__a), unsigned int \
18785 : ((vector unsigned int)__a), float \
18786 : ((vector float)__a))
18790 static __inline__ vector
double __ATTRS_o_ai vec_splatid(
const float __a) {
18791 return ((vector
double)((
double)
__a));
18796 static __inline__ vector
signed int __ATTRS_o_ai vec_splati_ins(
18797 vector
signed int __a,
const unsigned int __b,
const signed int __c) {
18798 const unsigned int __d =
__b & 0x01;
18799 #ifdef __LITTLE_ENDIAN__
18809 static __inline__ vector
unsigned int __ATTRS_o_ai vec_splati_ins(
18810 vector
unsigned int __a,
const unsigned int __b,
const unsigned int __c) {
18811 const unsigned int __d =
__b & 0x01;
18812 #ifdef __LITTLE_ENDIAN__
18823 vec_splati_ins(vector
float __a,
const unsigned int __b,
const float __c) {
18824 const unsigned int __d =
__b & 0x01;
18825 #ifdef __LITTLE_ENDIAN__
18838 vec_test_lsbb_all_ones(vector
unsigned char __a) {
18839 return __builtin_vsx_xvtlsbb(
__a, 1);
18845 vec_test_lsbb_all_zeros(vector
unsigned char __a) {
18846 return __builtin_vsx_xvtlsbb(
__a, 0);
18853 vec_stril(vector
unsigned char __a) {
18854 #ifdef __LITTLE_ENDIAN__
18855 return __builtin_altivec_vstribr((vector
signed char)
__a);
18857 return __builtin_altivec_vstribl((vector
signed char)
__a);
18862 vec_stril(vector
signed char __a) {
18863 #ifdef __LITTLE_ENDIAN__
18864 return __builtin_altivec_vstribr(
__a);
18866 return __builtin_altivec_vstribl(
__a);
18871 vec_stril(vector
unsigned short __a) {
18872 #ifdef __LITTLE_ENDIAN__
18873 return __builtin_altivec_vstrihr((vector
signed short)
__a);
18875 return __builtin_altivec_vstrihl((vector
signed short)
__a);
18880 vec_stril(vector
signed short __a) {
18881 #ifdef __LITTLE_ENDIAN__
18882 return __builtin_altivec_vstrihr(
__a);
18884 return __builtin_altivec_vstrihl(
__a);
18890 static __inline__
int __ATTRS_o_ai vec_stril_p(vector
unsigned char __a) {
18891 #ifdef __LITTLE_ENDIAN__
18892 return __builtin_altivec_vstribr_p(
__CR6_EQ, (vector
signed char)
__a);
18894 return __builtin_altivec_vstribl_p(
__CR6_EQ, (vector
signed char)
__a);
18898 static __inline__
int __ATTRS_o_ai vec_stril_p(vector
signed char __a) {
18899 #ifdef __LITTLE_ENDIAN__
18900 return __builtin_altivec_vstribr_p(
__CR6_EQ,
__a);
18902 return __builtin_altivec_vstribl_p(
__CR6_EQ,
__a);
18906 static __inline__
int __ATTRS_o_ai vec_stril_p(vector
unsigned short __a) {
18907 #ifdef __LITTLE_ENDIAN__
18908 return __builtin_altivec_vstrihr_p(
__CR6_EQ, (vector
signed short)
__a);
18910 return __builtin_altivec_vstrihl_p(
__CR6_EQ, (vector
signed short)
__a);
18914 static __inline__
int __ATTRS_o_ai vec_stril_p(vector
signed short __a) {
18915 #ifdef __LITTLE_ENDIAN__
18916 return __builtin_altivec_vstrihr_p(
__CR6_EQ,
__a);
18918 return __builtin_altivec_vstrihl_p(
__CR6_EQ,
__a);
18925 vec_strir(vector
unsigned char __a) {
18926 #ifdef __LITTLE_ENDIAN__
18927 return __builtin_altivec_vstribl((vector
signed char)
__a);
18929 return __builtin_altivec_vstribr((vector
signed char)
__a);
18934 vec_strir(vector
signed char __a) {
18935 #ifdef __LITTLE_ENDIAN__
18936 return __builtin_altivec_vstribl(
__a);
18938 return __builtin_altivec_vstribr(
__a);
18943 vec_strir(vector
unsigned short __a) {
18944 #ifdef __LITTLE_ENDIAN__
18945 return __builtin_altivec_vstrihl((vector
signed short)
__a);
18947 return __builtin_altivec_vstrihr((vector
signed short)
__a);
18952 vec_strir(vector
signed short __a) {
18953 #ifdef __LITTLE_ENDIAN__
18954 return __builtin_altivec_vstrihl(
__a);
18956 return __builtin_altivec_vstrihr(
__a);
18962 static __inline__
int __ATTRS_o_ai vec_strir_p(vector
unsigned char __a) {
18963 #ifdef __LITTLE_ENDIAN__
18964 return __builtin_altivec_vstribl_p(
__CR6_EQ, (vector
signed char)
__a);
18966 return __builtin_altivec_vstribr_p(
__CR6_EQ, (vector
signed char)
__a);
18970 static __inline__
int __ATTRS_o_ai vec_strir_p(vector
signed char __a) {
18971 #ifdef __LITTLE_ENDIAN__
18972 return __builtin_altivec_vstribl_p(
__CR6_EQ,
__a);
18974 return __builtin_altivec_vstribr_p(
__CR6_EQ,
__a);
18978 static __inline__
int __ATTRS_o_ai vec_strir_p(vector
unsigned short __a) {
18979 #ifdef __LITTLE_ENDIAN__
18980 return __builtin_altivec_vstrihl_p(
__CR6_EQ, (vector
signed short)
__a);
18982 return __builtin_altivec_vstrihr_p(
__CR6_EQ, (vector
signed short)
__a);
18986 static __inline__
int __ATTRS_o_ai vec_strir_p(vector
signed short __a) {
18987 #ifdef __LITTLE_ENDIAN__
18988 return __builtin_altivec_vstrihl_p(
__CR6_EQ,
__a);
18990 return __builtin_altivec_vstrihr_p(
__CR6_EQ,
__a);
18996 #ifdef __SIZEOF_INT128__
18997 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
18998 vec_sl(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
18999 return __a << (
__b % (vector
unsigned __int128)(
sizeof(
unsigned __int128) *
19004 vec_sl(vector
signed __int128
__a, vector
unsigned __int128
__b) {
19005 return __a << (
__b % (vector
unsigned __int128)(
sizeof(
unsigned __int128) *
19009 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
19010 vec_sr(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
19011 return __a >> (
__b % (vector
unsigned __int128)(
sizeof(
unsigned __int128) *
19016 vec_sr(vector
signed __int128
__a, vector
unsigned __int128
__b) {
19018 vector
signed __int128)(((vector
unsigned __int128)
__a) >>
19020 (vector
unsigned __int128)(
sizeof(
19021 unsigned __int128) *
19025 static __inline__ vector
unsigned __int128
__ATTRS_o_ai
19026 vec_sra(vector
unsigned __int128
__a, vector
unsigned __int128
__b) {
19028 vector
unsigned __int128)(((vector
signed __int128)
__a) >>
19030 (vector
unsigned __int128)(
sizeof(
19031 unsigned __int128) *
19036 vec_sra(vector
signed __int128
__a, vector
unsigned __int128
__b) {
19037 return __a >> (
__b % (vector
unsigned __int128)(
sizeof(
unsigned __int128) *
19044 #ifdef __POWER8_VECTOR__
19045 #define __bcdadd(__a, __b, __ps) __builtin_ppc_bcdadd((__a), (__b), (__ps))
19046 #define __bcdsub(__a, __b, __ps) __builtin_ppc_bcdsub((__a), (__b), (__ps))
19048 static __inline__
long __bcdadd_ofl(vector
unsigned char __a,
19049 vector
unsigned char __b) {
19053 static __inline__
long __bcdsub_ofl(vector
unsigned char __a,
19054 vector
unsigned char __b) {
19058 static __inline__
long __bcd_invalid(vector
unsigned char __a) {
19062 static __inline__
long __bcdcmpeq(vector
unsigned char __a,
19063 vector
unsigned char __b) {
19067 static __inline__
long __bcdcmplt(vector
unsigned char __a,
19068 vector
unsigned char __b) {
19072 static __inline__
long __bcdcmpgt(vector
unsigned char __a,
19073 vector
unsigned char __b) {
19077 static __inline__
long __bcdcmple(vector
unsigned char __a,
19078 vector
unsigned char __b) {
19082 static __inline__
long __bcdcmpge(vector
unsigned char __a,
19083 vector
unsigned char __b) {
19087 #endif // __POWER8_VECTOR__
19089 #undef __ATTRS_o_ai